multithreading

Peter Hansen peter at engcorp.com
Tue May 21 00:29:22 EDT 2002


David LeBlanc wrote (top-posting):
> 
> Aahz wrote:
> > David LeBlanc <whisper at oz.net> wrote:
> > >Lock, Semaphore and friends mentioned in the pythondoc (2.2.1) aren't
> > >atomic? If not, then they're misnamed since atomicity is a required
> > >property of such operations.
> >
> > What Peter meant is that Queue is the only single atomic operation for
> > passing data between threads.  Lock & Semaphore are atomic, but they
> > aren't by themselves sufficient for passing data.
>
> Although, of course, you can create any access managed datatype as long as
> the primatives are there...

At great risk of creating all kinds of difficulty like deadlocks 
if you are not very experienced and knowledgeable about such things.

Queue is much, much safer for someone who isn't sure, which was the
point of my earlier post.

-Peter



More information about the Python-list mailing list