[Haskell-cafe] File locking wishlist

Bulat Ziganshin bulat.ziganshin at gmail.com
Thu Jun 5 12:45:48 EDT 2008


Hello Joachim,

Thursday, June 5, 2008, 7:22:44 PM, you wrote:

>  * Only one instance of the program runs at a time.
>  * If new events come in while the program runs, it should re-run itself
>  * There is information attached to the events (only one Bool ATM)

> So I’d like to implement something with this, or a similar, interface:

isn't it better to provide os-independent interface to semaphores?
named semaphores both on windows and unix may be used to implement
functionality you required and it's a more natural way

there is useful article [1] which describes both windows and unix way to
threads/events/semaphores/mutexes. how about implementing lightweight
library which abstracts over these differences?

OTOH, i've just recalled one C++ library which does exactly this job [2].
may be providing Haskell interface for it will be a better idea?


[1] http://www.ibm.com/developerworks/linux/library/l-ipc2lin1.html
[2] Abstraction of multitasking, file IO and socket IO for Unix and
    Windows systems http://www.garret.ru/~knizhnik/sal-108.zip

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list