Boost logo

Boost Users :

From: Delfin Rojas (drojas_at_[hidden])
Date: 2005-05-30 12:43:34

> Matthias Kaeppler wrote:
> Howdy,
> I'm planning to use Boost.Thread in my program to utilize concurrency.
> I already had a closer look at the documentation and I noticed that it's
> lacking most parts for which I would consult a documentation in the
> first place:
> 1. API reference

I agree the documentation of Boost.Thread might be a little difficult to
navigate. Personally I preferred the documentation in 1_31_0 much better but
everything is there, you just have to search...

API reference:

Go to and see the "Reference"
section. For example, clicking on the "Header <boost/thread/thread.hpp>"
link will take you to that file's documentation from where you can go to the
documentation of any class or function in that file (class thread and
thread_group in this case). For example if you click on the "class thread"
link you end up at which contains
the full API reference of the class boost::thread.

> 2. A user guide showing how to use Boost.Thread in practical examples

Most boost libraries come with examples and even the ones that don't come
with tests (which in a way are examples of usage). For Boost.Thread go to
your boost installation and look inside libs/thread/example. There is also a
libs/thread/tutorial directory full of goodies.

The documentation page also provides examples. The "Concepts" page tells you
how to use boost::mutex and locks. The "Rationale" section the same.

> The only code examples I spotted were pseudo-code which were pretty
> meaningless to me.
> For example:
> void foo()
> {
> create_thread(&bar);
> }
> What is create_thread? Which arguments does it take? What is bar?

This is not precisely pseudo-code but some parts have been omitted. I
believe the purpose of that code is to illustrate use patterns.
create_thread is a method of thread_group which you use to create a thread
and bar is a functor for your thread proc.

> I know I can't demand anything from the author since it's free software,
> but... this is simply not very helpful. So, does anyone know a good
> source with examples and maybe even an API reference of Boost.Thread?

Hope that helps.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at