Semaphore question

Jeff Shannon jeff at
Thu Jan 31 22:09:08 CET 2002

MDK wrote:

> Never mind.  I figured out what I was doing wrong. It was in a 'try' so I
> did not see the error.  I just needed to add 'self.' to the lock object.
> Oops.
> Thanks.

Good that you got that working, but seriously...

Your initial description of your problem is *exactly* what Queue.Queue is
designed for, and it does it very simply, smoothly, and easily.  If you don't
use Queue, you're re-inventing the wheel, and probably won't do it quite as
thoroughly as Queue did.

And even if you *do* want to re-invent the wheel, you should read Queue's
source so that you can see how it ought to be done.  ;)

Jeff Shannon
Credit International

More information about the Python-list mailing list