Ruby sleep is based on the system time, and it doesn't work well for me,
since my system time can fluctuate.
I need a sleep based on cpu ticks, or something like this, does ruby has
a way to do this? Anyone has an alternative for it, or a ruby sleep
implementation based on ticks?
On Oct 10, 2008, at 10:47 AM, Ricardo Giorni wrote:
I need a sleep based on cpu ticks, or something like this, does ruby has
a way to do this? Anyone has an alternative for it, or a ruby sleep
implementation based on ticks?
I need a sleep based on cpu ticks, or something like this, does ruby has
a way to do this? Anyone has an alternative for it, or a ruby sleep
implementation based on ticks?
Does your system support select()?
Doesn't #sleep use select() anyway, via rb_thread_wait_for()?
···
On Oct 10, 2008, at 10:47 AM, Ricardo Giorni wrote:
--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
Ruby sleep is based on the system time, and it doesn't work well for me,
since my system time can fluctuate.
What exactly is this supposed to mean? Does your system clock change arbitrarily? That sounds like a very bad thing to have and I would try to fix it.
System clocks are not generally guaranteed to be accurate to the same level that processor ticks guarantee. So you can run into cases where short sleeps never happen or run arbitrarily too long.
Of course in Ruby (MRI) thread scheduling is largely cooperative, so the OP is probably expecting a lot out of it anyway.
I need a sleep based on cpu ticks, or something like this, does ruby has
a way to do this? Anyone has an alternative for it, or a ruby sleep
implementation based on ticks?
Does your system support select()?
Doesn't #sleep use select() anyway, via rb_thread_wait_for()?