English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    
Browse thread
Thread.delay afraid of SIGTERM
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel_BĂĽnzli <daniel.buenzli@e...>
Subject: Re: [Caml-list] Thread.delay afraid of SIGTERM
Paolo,

>From http://ocamlunix.forge.ocamlcore.org/threads.html#htoc63 :

val delay : float -> unit
This primitive is provided for portability with vm-level threads, but
delay s is simply an abbreviation for ignore (Unix.select [] [] [] s).
This call, unlike join, is not restarted when it is interrupted by a
signal.

So the error you see here is Unix.EINTR: the call to select in delay
is interrupted by your signal. For more information about Unix.EINTR :

http://ocamlunix.forge.ocamlcore.org/signals.html#sec/sigsyscalls

As for the difference with Unix.sleep, the latter does not raise EINTR
on signal interruption it just returns earlier with the unslept amount
(which is not reported in OCaml), see sleep(3).

Best,

Daniel