Implemented Concepts

The following concepts have been implmented:
barrier
Syncronise threads at a given point. When a thread reaches a barrier, it sits there until as many threads as specified in the barrier has reached that point. After that all threads are released. One of the released theads become a `serial' thread (I haven't checked up yet what that means).

Note: This feature may not be supported by the underlying thread library. In this case, an emulation based on mutex and condition variables is used (threadmm::basic::barrier).

cleanup
Thread clean-up on cancellation. This is implmented as a guard i.e., the clean-up happens when the guard goes out of scope.

Note: This feature may not be supported by the underlying thread library. In this case, an emulationis used (threadmm::basic::cleanup_guard).

condition
Condition variables. Block a thread until a the condition variable becomes non-zero, indicating that some other thread has finish it's task.

mutex
MUTually EXclusive locks. Only one thread can hold the lock on a mutex, and hence the thread can restrict other threads from tampering with global data until the thread is ready to release it.

rwlock
Reader/Writer lock. Any number of readers can get a lock if there's no writer. A writer can get a lock if there's no other writers and no readers.

Note: This feature may not be supported by the underlying thread library. In this case, an emulation is used (threadmm::basic::rwlock).

semaphore
Signal other threads that a task was done by raising the semahore.

Note: This feature may not be supported by the underlying thread library. In this case, an emulation is used (threadmm::basic::semaphore).

spinlock
I need to check up on this.

Note: This feature may not be supported by the underlying thread library. In this case, an emulation is used (threadmm::basic::spinlock).

thread
Parallel execution of code. In a "normal" program, only one given piece of code (member function, global function) can be executed at a time. Using threads, one can branch a program into several "%threads" of execution, each executing concurrently (well, almost).

thread_specific
Thread specific data, is that data that is, well, specific to each thread, but otherwise shared. That is, an integer variable tss may exist in all threads by inheriting it from the initial thread (program), but it may have the value 10 in one thread, and 42 in another thread. This is different from normal shared data that has the same value in all threads. This class uses a powerful pattern called double-checked locking to avoid race conditions.

Note: This feature may not be supported by the underlying thread. Usage will result in a compile time error.

Convinience Concepts

These classes are implemented as a convinience and are largely independent of the underlying thread library, other then it must provide the needed features via the above concepts.
object_thread
A convinience class for executing an arbitriary class in a seperate thread of execution.

lock_guard
A convinience class for automatically releasing a lock (often a mutex) when exiting the current scope. This makes it easier not to forget to release locks.

lock_ptr
A smart pointer that locks access to it's contained data. The lock is automaically released when exiting the current scope. This makes it easier not to forget to release locks.
Other such concepts may be implemented in the future.
Top of page
Last update Tue Nov 9 12:40:50 2004
Christian Holm
Created by DoxyGen 1.3.9.1