Codebase list cothreads / master
master

Tree @master (Download .tar.gz)

=============================================================================

                        OCaml coThreads


            (C) 2007 by Zheng Li (li@pps.jussieu.fr)                   

=============================================================================



== Description ==

coThreads is a [[doc/concurrency.and.parallelism|concurrent/parallel]] programming library for OCaml. It enhances the Threads library of the standard OCaml distribution in the two dimensions:

 * coThreads implements the same API of the standard Threads library as different execution engines (process, netwoker(TODO)), so that a single copy of source code can be compiled and deployed to different environments without modification
 * coThreads is also a super set of the standard Threads library, with extra components (STM etc.), functions (spawn etc.), and features (object-level compatibility etc.) 


=== Features ====

The design of coThreads brings several advantages:

==== Powerfulness ====
 * The process engine can give you real speedup on a multi-processor machine, the networker engine (TODO) will give you both speedup and scalability.
 * Combining the original components from the Threads library and the new added ones, coThreads is a full-fledged toolbox covering two main concurrent programming [[doc/paradigm|paradigms]], namely shared-memory and message passing, with both high-level and low-level constructors. 
 * All constructors (e.g. threads, mutex, condition, event, channel, tvar etc.) can be manipulated as first class values, they can even be communicated and shared between independent threads through channels etc..

==== Compatibility ====
 * Fully [[doc/compatibility|compatibility]] with the original Threads library (systhreads and vmthreads), so that you can now deploy your legacy code to new environment for free --- without modifying source code, without learning anything new.
 * Both source-level and object-level compatibility among different execution engines, so that you can keep a single copy of source code and a single copy of objects files.

==== Convenience ====
 * The full library is implemented in user-space, no modification to the OCaml compiler and runtime, so that you can [[doc/usage|use]] it as a set of plain modules.
 * Switching engines is as easy as changing the include paths of compilation, and it's quite easy to automate the building process over a set of engines (e.g. with lines of pattern rules in your Makefile) 


== More ==

Everything at http://cothreads.sf.net