harvard-acc/DeepRecSys

`inferenceEngineReadyQueue.put(True)` in a while loop?

Closed this issue · 1 comments

while True:
inferenceEngineReadyQueue.put(True)

Should this be in a while loop?

From what I understand, each inference engine should signal the ReadyQueue only once, just as in accelInferenceEngine for example:

else:
inferenceEngineReadyQueue.put(True)

Also, the queue is consumed for exactly args.inference_engines number of times, and is not consumed anymore afterwards

while ready_engines < args.inference_engines:
inferenceEngineReadyQueue.get()
ready_engines += 1

It seems like the statement in the while loop will keep piling elements in the ReadyQueue for each request that it handles, and if it reaches the maximum queue size (32767?) it might cause some sort of a deadlock, it seems.

Please confirm whether I understood correctly.

Thanks.

Dear SungMinCho,

You are correct that the inferenceEngineReadyQueue.put(True) should be run only once and moved to the above (outside) the start of the while loop. If you could make the pull request I can help approve the change.

Thank you for catching this error and suggesting the fix!