[erlang-questions] sleep for a few microsconds

PAILLEAU Eric eric.pailleau@REDACTED
Sat Nov 18 12:03:18 CET 2017


Hi,

Erlang is soft real time, not hard realtime.
I think it is hard to achieve an "exact" nanosleep in particular on 
multiCPU .

Did you tried using a custom recursing function where argument is 
(somewhat) linear to execution time ?

regards


Le 16/11/2017 à 21:27, Atul Goyal a écrit :
> Ya ... i checked nanosleep accuracy in pure c first .. with rt priority 
> too ... it was quite accurate..
> And i am using a physical machine .
> Thanks
> 
> 
> On 17-Nov-2017 01:14, "Sergej Jurečko" <sergej.jurecko@REDACTED 
> <mailto:sergej.jurecko@REDACTED>> wrote:
> 
>     Have you tried nanosleep accuracy in a simple C program by itself?
>     Especially on a non-idle machine. Also I hope you’re not running or
>     planning on running anything like that in a VM.
> 
>     Regards,
>     Sergej
> 
>      > On 16 Nov 2017, at 08:27, Atul Goyal <atulindore2@REDACTED
>     <mailto:atulindore2@REDACTED>> wrote:
>      >
>      > hi
>      >
>      > I was wondering if there is a way to sleep for few u'sec in
>     erlang . We are working on  Linux. And we have tried following
>     solutions :
>      >
>      > 1. Used linux 'nanosleep' from a 'C' NIF ::
>      > Gives 50-90% error between 1-500 microsec ... and even at 1500
>     microsec it gives 10-20% error . I tried giving high priority to
>     Beam process .. same results
>      >
>      > 2.Busywait in Erlang function  ::
>      > Isnt practical to waste CPU time when serving a large number of
>     users ...Also it is only good for about 90% of the time but rest of
>     the time gives 50-200% error ...
>      >
>      > thanks a lot
>      > Atul
>      > _______________________________________________
>      > erlang-questions mailing list
>      > erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
>      > http://erlang.org/mailman/listinfo/erlang-questions
>     <http://erlang.org/mailman/listinfo/erlang-questions>
> 
> 
> 
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
> 




More information about the erlang-questions mailing list