Python Thread Question

Anand B Pillai abpillai at lycos.com
Tue Apr 22 02:50:06 EDT 2003


Thanks for your replies. It has helped
clear my ideas on threading. 

Anand

Jp Calderone <exarkun at intarweb.us> wrote in message news:<mailman.1050593376.21366.python-list at python.org>...
> 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.
> 
>   Jp
> 
> -- 
> 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




More information about the Python-list mailing list