Threading unfairness

Jochen Küpper jochen at jochen-kuepper.de
Tue May 21 00:35:42 EDT 2002


On Tue, 21 May 2002 00:26:55 -0400 Peter Hansen wrote:

Peter> Jochen Küpper wrote:

>> On Linux the resolution of select is depending on the HZ kernel config
>> variable.  On x86 it is (standard-wise) 100 (Hz), giving you 10 ms.

Peter> So does that mean that while time.sleep(0.01) really sleeps for 10 ms, 
Peter> time.sleep(0.001) translates to a "yield", or does it round up to
Peter> the next tick?  (Or if you'd rather teach me how to fish, where's
Peter> a good place (please don't say "the source" ;-) to find this out myself?

I'd say you would look up the kernel source; or maybe glibc is good
enough... :)) Am not sure.  The man-page says that 'timeout' is an
upper bound, but I think that is sloppy.  I seem to remember that it
always waits at least one scheduler cycle on a blocking call.  Ask a
guru, though.

Greetings,
Jochen

Ps: Since you don't like Luke



the source, Stevens book(s) on IPC
    might be a good source for this kind of stuff.  (Sorry, my copies
    are ~6000 km away.)
-- 
Einigkeit und Recht und Freiheit                http://www.Jochen-Kuepper.de
    Liberté, Égalité, Fraternité                GnuPG key: 44BCCD8E
        Sex, drugs and rock-n-roll



More information about the Python-list mailing list