jepri has asked for the wisdom of the Perl Monks concerning the following question:
It seems there is no perl command that causes perl to give up the remains of it's timeslice. Languages like Visual Basic have some kind of "do_events" call (in fact I think it's a windows API).
When this is called, the program finsihes it's allocated timeslice early, handing it over to the kernel to be spent as needed somewhere else.
This is fantastic for those moments when you just want to check something as often as possible, as long as it doesn't get it anyones way.
Sleep doesn't really cut it, because you are then fixing yourself to only check a fixed number of times per second.
Block isn't it either, because you might want to do a few tasks before you check and &do_events.
So is there an easy solution? Is there a solution at all? Should I submit this for Perl 6 or has someone done so already?
____________________
Jeremy
I didn't believe in evil until I dated it.
|
|---|