Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Library using blocking Unix functions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Patrick M Doane <patrick@w...>
Subject: Re: [Caml-list] Library using blocking Unix functions
Hello,

If it is reasonable for you to use version 3.01, then I think your problem
is solved.  Here is an excerpt from the manual for the ThreadUnix module:

  This module is deprecated: its functionality has been merged back into
  the Unix module. Threaded programs can now call the functions from
  module Unix directly, and still get the correct behavior (block the
  calling thread, if required, but do not block all threads in the
  process). 

Patrick Doane

On Sun, 24 Jun 2001, Nicolas GEORGE wrote: 

> I am trying to write a small library that needs blocking functions. And
> I have a problem with these: they exist in Unix and ThreadUnix. This is
> not a problem for a self-contained application, where one know if it is
> threaded or not (even there, switching from non-threaded to threaded may
> cause errors). But this means that the same library can not be used in
> both cases. 
> 
> One solution could be for _every_ module in the library to be a functor in
> term of an ThreadUnix-like module, but I find that hevay and inelegant.
> 
> Something more elegant would be, I think, to have a unique module, let us
> say BlockingUnix, with two implementations, one in the standard directory,
> and another in the directory with the threaded library, that have exactly
> the same interface (the .cmi should have the same md5 sum).
> 
> I wonder what people here think about this.
> -------------------
> Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
> To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr
> 

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr