I am wondering if you could lock a specific variable with thread locking. Let me illustrate:
def ftpQueuePut(filename="")::
if len(filename) > 0:
try:
fileQueue.put (filename,True,1) #Variable that I would like to lock
except Queue.full:
print "Queue is full"
else:
pass
def ftpQueueGet():
try:
filename= fileQueue.get(True,1) #Variable that I would like to lock
return filename
except Queue.Empty:
pass
Presently, the only way that I can see to do this using Python is to combine the two functions into one and lock and unlock the entire thing . That doesn't seem efficient and/or elegant to me. Any pointers about this?
-Tino
_______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
