> I implemented a trivial "database", stored in ordinary files, 
> and had to
> ensure mutual exclusion of database access between 
> simultaneously running
> CGI scripts. Since each CGI run is short, I simply locked the entire
> database for the entire run. Claiming a lock on a file is 
> easy in C (well,
> it takes 18 lines...), but there's nothing in the standard Haskell
> libraries that can do it. So I borrowed a little C code from 
> the net, and
> called it via the FFI.

Locking support is available in the unix package distributed with GHC.
See:

http://www.haskell.org/ghc/docs/latest/html/unix/System.Posix.IO.html#7


Cheers,
        Simon

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to