[Unison-hackers] unison and inotify principle

Sylvain Le Gall sylvain at le-gall.net
Thu Jun 5 04:16:08 EDT 2008


On 05-06-2008, Sylvain Le Gall <sylvain at le-gall.net> wrote:
> On 05-06-2008, Benjamin Pierce <bcpierce at cis.upenn.edu> wrote:
>>> First of all, I have to tell that I don't understand the language  
>>> used to develop unison (OCaml ?). So I will not be able to help is  
>>> this way. But for an external tool, why not ...
>>>
>>> Concerning Sylvain's design, I fully agree. Using a pipe to send  
>>> external notifications to unison should be very efficient (under  
>>> Linux and Windows, at least).
>>
>> What happens if the pipe fills up?
>>
>
> Read/Write on pipe are blocking. If the pipe contains too much data, it
> just freeze the process trying to write on it, until the other end read
> it...
>
> (well you maybe have a buffer, but if the buffer is full, the process
> will freeze). 
>

Forget to say: you can use "Unix.select" or similar polling function to
check if there are data to be readi/write (not very portable though, but
better than nothing).

Unix.select will work on Mac and Linux. It will work on Windows with
OCaml 3.11

Regards,
Sylvain Le Gall



More information about the Unison-hackers mailing list