[erlang-questions] erlang:send_after accuracy on os x

Camille Troillard tuscland@REDACTED
Tue May 5 20:36:25 CEST 2009


On Tue, May 5, 2009 at 7:04 PM, Scott Lystig Fritchie
<fritchie@REDACTED> wrote:
>
> It's probably not the VM's problem: it's a matter of the resolution of
> interrupts provided by the OS.  FreeBSD has historically used a 100Hz
> timer, which gives a minimum resolution of 10ms.  My guess is that OS X
> uses the same frequency.  In Linux land, the timer resolution is defined
> at compile time, and newer kernels also provide the "tickless" option.
>
> As Sergej has discovered, using a different system call can indeed yield
> finer resolution.  But IIRC usleep() isn't safe to use in multithreaded
> apps.

Thanks Scott, this is very instructive.
I found that I did not express precisely what I meant.
In my previous email I was actually wondering why Erlang did not
provide a portable and precise timer function?  For me, writing a erl
driver looks a bit like re-inventing the wheel.

What do you think?
How does anybody do on systems other than Linux?


Cam



More information about the erlang-questions mailing list