Python Thread Question
exarkun at intarweb.us
Thu Apr 17 17:26:21 CEST 2003
On Thu, Apr 17, 2003 at 10:46:48AM -0400, Aahz wrote:
> [Mostly good answers from Jp, but one correction is needed]
> > [snip]
> > Context switches are usually relatively cheap compared to what your
> >app is actually doing, though, so the difference between doing blocking
> >IO in a multi-thread app and non-blocking IO in a single-thread app
> >isn't always obvious. (Other things associated with multi-threaded
> >apps, such as deadlocks and race conditions are, though ;)
> This isn't quite true on a multi-CPU box. Because I/O releases the GIL,
> the OS can schedule threads to run on all available CPUs. So it's
> certainly possible for a threaded app to outrun non-blocking I/O.
Quite right. Thanks for the correction.
Examinations are formidable even to the best prepared, for
even the greatest fool may ask more the the wisest man can answer.
-- C.C. Colton
up 28 days, 11:02, 6 users, load average: 0.01, 0.03, 0.00
More information about the Python-list