Microthreads

Tim Peters tim.one at comcast.net
Sat May 17 19:26:46 EDT 2003


[Gary Richardson]
> In David Mertz's article on microthreads
> http://www-106.ibm.com/developerworks/linux/library/l-pythrd.html
> the script in Listing 2 (appended below) attempts to characterize the
> overhead of his scheme. It creates 100,000 threads and measures the time
> to perform one million context switches. On my computer (400 MHz AMD-K6,
> Win98 SE, 192 MB ram) this took about 40 seconds. The article states that
> on a 366 MHz Pentium II laptop the time was about 10 seconds. I'm using
> Python 2.2, Pythonwin, win32all build 146.
> Is my computer really sick?

It is peculiar.  Are you running from *within* PythonWin, or from a DOS box?
On a Win98SE machine here, 866 MHz, 256MB, Pentium III, from a DOS box:

under 2.2.2:   4.2 seconds
under 2.3b1+:  2.4 seconds






More information about the Python-list mailing list