caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Zheng Li <li@pps.jussieu.fr>
To: caml-list@inria.fr
Subject: Re: [ANN] coThreads 0.10
Date: Thu, 20 Sep 2007 10:18:51 +0200	[thread overview]
Message-ID: <87lkb1kavo.fsf@pps.jussieu.fr> (raw)
In-Reply-To: <1190249430.6642.1.camel@rosella.wigram>


Hi,

First note that the naming convention follows the standard threads library in
OCaml: Threads and coThreads (both with 's') refer to the library (*.cm(x)a);
Thread and Cothread (neither with 's') are modules (*.cm[ox]) inside.

skaller <skaller@users.sourceforge.net> writes:
>> The Thread module interfaces from the three engines differ with each
>> other! Note that this is not the problem from coThreads, it's a problem of
>> standard Threads library:
>
> Why don't you just use a different module name?
The different module name *is* Cothread, a compatible super set of Thread
module. Use this module instead if you want to have object-level
compatibility. In short, all the three engines have the two libraries with
isomorphic structures (quite simple) :

<code>
  threads.cm(x)a = threads.cm[ox], mutex.cm[ox], condition.cm[ox], event.cm[ox]
cothreads.cm(x)a = threads.cm[ox], mutex.cm[ox], condition.cm[ox], event.cm[ox], cothread.cm[ox], stm.cm[ox]
</code>

See, we also provide the compatible "threads.cm(x)a" for the process
engine. Think about the following scenario:

 - If you're working on legacy code, you don't care STM and don't care
   object-level compatibility, the only thing you're interested is to running
   your code with process to speedup, then the only thing to change in your
   Makefile is the include path e.g. "-I +threads" -> "-I +process", you can
   still using Thread module and "threads.cma", they are present in process
   engine.

 - You have several projects, some of them using traditional Threads, some
   using coThreads, you don't want to bother to remember that. So simply
   changing all linking library from threads.cma to cothreads.cma is fine,
   because coThreads library contains every modules in Threads library.

 - You have some legacy code written in standard Threads, and you'd like to
   have it run with processes. Though you don't care about the newly introduced
   modules of coThreads, you do want to have a single copy of object files for
   each engines. In such case, you need to add one line to any source code
   which makes use of the Thread module:

   module Thread = Cothread

   because Thread module (the only module in Threads and coThreads) don't have
   object-level compatibility, and change any occurrence of “threads.cm(x)a” to
   “cothreads.cm(x)a” in your Makefile. 

For more explanation, see http://cothreads.sourceforge.net/doc/compatibility

-- 
Zheng Li
http://www.pps.jussieu.fr/~li


  parent reply	other threads:[~2007-09-20  8:15 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-17 16:31 Zheng Li
2007-09-17 16:48 ` Zheng Li
2007-09-17 17:39   ` [Caml-list] " skaller
2007-09-17 17:51     ` Zheng Li
2007-09-17 21:33       ` [Caml-list] " skaller
2007-09-17 22:37         ` Zheng Li
2007-09-17 23:26           ` [Caml-list] " skaller
2007-09-18  0:16             ` Zheng Li
2007-09-18  0:53   ` [Caml-list] " Erik de Castro Lopo
2007-09-18  1:25     ` Erik de Castro Lopo
2007-09-18  4:29     ` skaller
2007-09-19 10:11   ` Erik de Castro Lopo
2007-09-19 10:58     ` Can coThreads be used for message passing architecture? Jan Kybic
2007-09-19 11:13       ` [Caml-list] " Erik de Castro Lopo
2007-09-19 12:59         ` Zheng Li
2007-09-20  4:16         ` [Caml-list] " Jon Harrop
2007-09-20  6:11           ` Erik de Castro Lopo
2007-09-20  9:06             ` Zheng Li
2007-09-20  8:49           ` Zheng Li
2007-09-19 19:13   ` [Caml-list] Re: [ANN] coThreads 0.10 Vu Ngoc San
2007-09-19 20:10     ` Zheng Li
2007-09-20  0:50       ` [Caml-list] " skaller
2007-09-20  4:29         ` Erik de Castro Lopo
2007-09-20  7:11           ` skaller
2007-09-20  7:52             ` Erik de Castro Lopo
2007-09-20  8:37               ` Zheng Li
2007-09-20 10:43                 ` [Caml-list] " skaller
2007-09-20 10:44                   ` Matthew Hannigan
2007-09-20 15:02                     ` skaller
2007-09-20 15:07                       ` Christophe Raffalli
2007-09-20 15:51                         ` skaller
2007-09-20 16:26                       ` Florian Weimer
2007-09-20 17:37                         ` Vincent Aravantinos
2007-09-21 16:33                       ` readline license (was: [ANN] coThreads 0.10) Xavier Leroy
2007-09-21 17:11                         ` [Caml-list] " Matthew William Cox
2007-09-21 18:05                         ` skaller
2007-09-21 21:51                           ` [Caml-list] Re: readline license Markus E L
2007-09-21 22:16                             ` Daniel Bünzli
2007-09-22  0:49                           ` [Caml-list] Re: readline license (was: [ANN] coThreads 0.10) Matthew Hannigan
2007-09-20 11:39                   ` [Caml-list] Re: [ANN] coThreads 0.10 Florian Weimer
2007-09-20 15:46                     ` skaller
2007-09-20 18:14                       ` Ken Rose
2007-09-20  8:31           ` Zheng Li
2007-09-20  8:18         ` Zheng Li [this message]
2007-09-18  2:10 ` [Caml-list] " Erik de Castro Lopo
2007-09-18  5:59   ` skaller
2007-09-18  6:23     ` Erik de Castro Lopo
2007-09-18  9:01       ` Zheng Li
2007-09-18 13:40         ` Zheng Li
2007-09-18 23:53           ` [Caml-list] " Erik de Castro Lopo
2007-09-18  9:09       ` [Caml-list] " skaller
2007-09-18 13:03       ` Markus E L

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lkb1kavo.fsf@pps.jussieu.fr \
    --to=li@pps.jussieu.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).