Cheap Threads is a collection of portable C routines for implementing sychronous threads. It includes a scheduler and a facility for passing messages among threads. Threads may run in a round robin or according to a priority scheme. Each thread must voluntarily relinquish control from time so that other threads can run. Since the threads are synchronous, i.e. they don't interrupt each other, they don't need to use semaphores, mutexes, critical sections, or other facilities to keep from interfering with each other. One version of Cheap Threads is designed for embedded systems.
|Tags||Software Development Libraries|
|Operating Systems||OS Independent|
Release Notes: This release adds an optional ct_return() function by which a thread may return control to the scheduler by a setjmp/longjmp mechanism rather than by an ordinary function return. In some circumstances, ct_return() may be more efficient or more convenient. By default, ct_return() is disabled in order to avoid overhead for applications that don't use it, but you can enable it by using a compile-time macro.
Release Notes: The Cheap Threads functions can now be called directly from C++ programs. A new sample program, demo1, was included to demonstrate two threads that take turns writing to standard output.
Release Notes: A memory leak, which was introduced in v2.5, is now fixed. The leak occurred when activating a thread with an enqueue instead of a message.
Release Notes: The message-passing machinery now uses a reference-counting scheme to reduce the overhead of delivering messages. This change also reduces the use of memory, especially when distributing long messages to multiple threads. The API is unchanged.
Release Notes: Cheap Threads now offers a timeout facility as a compiletime option. A thread may put itself to sleep and be awakened after a specified interval, if some other event doesn't awaken it first. There is now a mailing list for discussion and support of Cheap Threads.