diff --git a/doc/faq.html b/doc/faq.html new file mode 100644 index 00000000..2ec4517d --- /dev/null +++ b/doc/faq.html @@ -0,0 +1,50 @@ + + + + + +Boost.Threads, FAQ + + + + + + + + + +
+

C++ Boost

+
+

Boost.Threads

+

Frequently Asked Questions

+
+ +
+ +

Are lock objects thread safe?

+ +

No! Lock objects are not meant to be shared between threads. They are meant to +be short lived objects created on automatic storage within a code block. Any other usage +is just likely to lead to errors and won't really be of actual benefit any way. Share +mutexes, not locks. For more information on this see the documentation on the +rationale behind the design for lock objects.

+ +

Why was Boost.Threads modelled after the (platform specific library name) +library?

+ +

It wasn't. As the developer I tried very hard to not let my own biases show in the +development of this library. Each library has its own strengths and weaknesses and I wanted +to avoid the mistakes made by others (though I'm sure I made plenty of my own). For instance, +inclusion of a max value for semaphores seemed like a smart decision despite the lack of support +for this concept in POSIX. On the other hand, lack of a condition variable concept in the +Windows API was a big mistake since it's the only way to model a monitor pattern. If you think +you see a bias for any platform/library, you're probably wrong.

+ +
+ +

Copyright William E. Kempf +2001 all rights reserved.

+ + + diff --git a/doc/index.html b/doc/index.html index e133fa64..48416810 100644 --- a/doc/index.html +++ b/doc/index.html @@ -48,6 +48,7 @@
  • Formal definition of "Thread"
  • Rationale for design decisions
  • +
  • Frequently Asked Questions

  • diff --git a/doc/rationale.html b/doc/rationale.html index 29951e29..3b3a6b42 100644 --- a/doc/rationale.html +++ b/doc/rationale.html @@ -28,7 +28,7 @@ design as well as prevent future rehashing of discussions and thought processes already occured. It can also give users a lot of insight into the design process required for this library.

    -

    Rationale for the Creation of Boost.Threads

    +

    Rationale for the Creation of Boost.Threads

    Processes often have a degree of "potential parallelism" and it can often be more intuitive to design systems with this in mind. Further, these parallel processes can result in more responsive @@ -53,7 +53,7 @@ for writing multi-threaded programs on numerous platforms. There's a hope that be the basis for a more detailed proposal for the C++ standards committee to consider for inclusion in the next C++ standard.

    -

    Rationale for the Low Level Primitives Supported in Boost.Threads

    +

    Rationale for the Low Level Primitives Supported in Boost.Threads

    The Boost.Threads library supplies a set of low level primitives for writing multi-threaded programs, such as semaphores, mutexes and condition variables. In fact, the first release of @@ -75,7 +75,7 @@ useful in and of themselves, even if it's hard to prove that their usage is corr many users will be familiar with these lower level concepts but be unfamiliar with any of the higher level concepts there's also an argument for accessibility.

    -

    Rationale for the Lock Design

    +

    Rationale for the Lock Design

    Programmers who are used to multi-threaded programming issues will quickly note that the Boost.Thread's design for mutex lock concepts is not thread safe (this is clearly documented @@ -105,7 +105,7 @@ safe. Instead, sharing a lock object between threads results in undefined behav only proper usage of lock objects is within block scope this isn't a problem, and so long as the lock object is properly used there's no danger of any multi-threading issues.

    -

    Rationale for Non-copyable Thread Type

    +

    Rationale for Non-copyable Thread Type

    Programmers who are used to C libraries for multi-threaded programming are likely to wonder why Boost.Threads uses a non-copyable design for boost::thread. After all, the C