Python threading?

Donn Cave donn at drizzle.com
Sat Sep 21 02:06:43 EDT 2002


Quoth Trent Mick <trentm at ActiveState.com>:
| [Robert Oschler wrote]
|> How can I tell if the version of Python I am running is thread-enabled?
|
| Run Lib/test/test_thread.py with your Python build. If you are on any
| common platform then Python, unless specifically crippled, is
| thread-enabled.

I think you know that doesn't include NetBSD, and I believe it doesn't
include MacOS either.  I'd call both of those common platforms, though
you can draw that line anywhere you want.

|> Also, what is a reasonable number of threads to expect to be able to run
|> before context switching overhead becomes a problem (I'm using a PIII 500
|> Mhz with 512MB ram if that helps).
|
| I have no experience putting that many threads to use.

Of course it would depend, too, on what "a problem" means, and on what
operating system the application is hosted on.  And it might be worth
mentioning that the Python parts of the application will not execute
in parallel, anyway, thanks to a global interpreter lock that can be
held by only one thread at a time.

	Donn Cave, donn at drizzle.com



More information about the Python-list mailing list