[Unison-hackers] Unix.sleep insufficient for -repeat! Need half seconds.

Ryan Newton rrnewton at gmail.com
Fri Apr 20 10:19:26 EDT 2007


Hello all,

I use the -repeat option *extensively* to establish a relatively low- 
bandwidth, poor man's distributed file system.  Basically, if my  
connection is good enough, I do development by running emacs over X11  
forwarding from the server.  If it's not good enough, I run emacs  
locally, use unison -repeat, and compile/run the program on the  
server over a simple ssh terminal.

I imagine many others use unison for this same purpose.

The problem is:  "unison -repeat 1" is too slow!  And "unison -repeat  
0" is too fast and too hard on both systems.  I need unison -repeat 0.5.

Of course, uitext.ml uses Unix.sleep, which will only sleep an  
integral number of seconds.  To my knowledge, the standard OCaml  
libraries don't include anything like C's "usleep".

However, I argue that wrapping usleep for Caml is easy, and worth  
doing!  Besides, I see that the unison repository already has some  
dependencies on C code.

Are there any objections to this small modification?  I haven't  
hacked unison before, but I might try making this change, in which  
case I'll submit a patch to this list.

Best,
-Ryan



More information about the Unison-hackers mailing list