Clone wiki

coco / Home


coco is a library that implements the Boost.Thread 1.34 interface but is written in terms of the operating system’s native cooperative threading mechanism, whether that be Fibers on Windows, or the <ucontext.h> functions on POSIX machines.

This means that multi-threaded programs written using Boost.Thread can now be run in a single thread. This is useful for debugging and testing purposes, where it is necessary to look at algorithmic correctness in isolation from correctness of synchronization. A motivating example can be found elsewhere.



Some stuff I would like to add:

  • coco currently mirrors version 1.34 of the boost threads API. It needs to be upgraded to incorporate recent changes
  • support for custom scheduling policies
  • debugging tools, such as deadlock and race detection
  • I may consider adding a "backend", or replacing the current one with code that targets boost.coroutine (as yet, not an official boost library)