Semaphore question
William Annis
annis at biostat.wisc.edu
Wed Jan 30 17:11:32 EST 2002
"MDK" <mdk at mdk.com> writes:
> Could someone give me a clear example of how to use Semaphore so that the
> threads properly acquire and release the Data list?
Take a look at the Queue module which comes with Python.
First, it is a data structure that acts a lot like what you're trying
to do. Second, it's pretty simple and uses mutexes (semaphores,
bascially, but of a simpler sort) to protect access.
--
William Annis - System Administrator - Biomedical Computing Group
"When men are inhuman, take care not to feel towards them as they do
towards other humans." Marcus Aurelius VII.65
More information about the Python-list
mailing list