MainThread blocks all others
Bryan Olson
fakeaddress at nowhere.org
Wed Aug 10 09:03:44 EDT 2005
Nodir Gulyamov wrote:
> Hi Bryan,
> Thanks for your reply.
> I tried to test your solution, but it doesn't work, hence
> threading.Semaphore object hasn't method to get value of semaphore.
> I looked to source code of semaphore.py and find out that value is
private
> variable.
Your code did not, and could not, use the value of counter for
anything but busy-waiting. You had:
while counter != 1:
pass
# ... continue...
If you replace this with the semaphore, you can just assume a
counter value of one.
--
--Bryan
More information about the Python-list
mailing list