-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
worker_active logic can be replaced with a break instead #239
Comments
Looking at this more, it's actually more complicated. Probably we should draw out what this state machine looks like before messing with it. |
I think the wait is there to make sure that no new jobs come in. Currently I think we load all jobs at the beginning and then never add any additional ones later but as far as I understood this was originally designed to also be able to stream input... |
You can feed jobs in until you send the shutdown sentinel. The issue here is that it is sleeping after the shutdown sentinel has been received before terminating the thread. There's not really anything else that the worker can do because after the sleep it will just die anyway. I think this is a left-over from the synchronised spider where we wanted to keep all workers alive until the end to be able to spin the semaphores, but I can't be sure yet. |
Okay. Was just guess which wait you meant... |
In the workers for running regular measurements we have a worker_active variable. This isn't ever useful afaict as as soon as it's set to false and if statement causes the loop to end anyway.
There's a wait at the end of the loop which doesn't seem to serve any purpose. Maybe we can just remove this.
The text was updated successfully, but these errors were encountered: