Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2001-06-24 (19:27)
From: Nicolas GEORGE <>
Subject: [Caml-list] Library using blocking Unix functions
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

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:  FAQ:
To unsubscribe, mail  Archives: