made it update the masterq only if the master told it to die
This commit is contained in:
parent
36ba080d14
commit
1e612ca070
@ -20,10 +20,10 @@ if sys.argv[1].startswith("st"):
|
||||
print " masterq : %d" % mq.qsize()
|
||||
print " slavesq : %d" % sq.qsize()
|
||||
|
||||
if sys.argv[1] == 'teardown':
|
||||
if sys.argv[1] == 'slay':
|
||||
for i in xrange(mq.qsize()):
|
||||
print i, "killing", mq.get()
|
||||
sq.put("teardown")
|
||||
sq.put("slay")
|
||||
|
||||
if sys.argv[1] == 'clear':
|
||||
for i in xrange(tq.qsize()): print tq.get()
|
||||
|
@ -55,13 +55,17 @@ if __name__ == '__main__':
|
||||
if options.verbose:
|
||||
print myname
|
||||
|
||||
|
||||
|
||||
while True:
|
||||
# indicate that I am loaded up, and ready for workload
|
||||
masterq.put(myname)
|
||||
# wait for master's start signal
|
||||
action = slavesq.get()
|
||||
if action == "teardown":
|
||||
# I take it back; I'm not ready!
|
||||
masterq.get()
|
||||
break
|
||||
elif action == "slay":
|
||||
break
|
||||
|
||||
while not tasksq.empty():
|
||||
|
Loading…
Reference in New Issue
Block a user