Somnus is a co-operative threading support library (See: Fiber).
Fibers are a powerful concurrency tool that prevents unnecessary blocking and operating system thread context switching. It's not a panacea, but it is a useful tool which, utilized in the proper way, yields massive performance gains.
Refer to the wiki for type and function documentation.
The canonical example of any coroutine based model is an example with a channel. The following two examples show the use of a channel for both pointer types and non-pointer types.
Event Dispatch Examples
An event dispatcher class is supplied along with the other functionality of the library. It uses Ropes internally based upon a configuration loaded from a file.
Long running tasks prevent other tasks from doing useful work, including initiation of long running operations. To prevent this, long running tasks should carefully place calls to defer() which switches to other waiting tasks, if needed. Execution will resume after all other waiting tasks have had an opportunity to run.