Skip to content
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

threads.Threads(...) constructor hangs in low-memory conditions #62

Open
vadimkantorov opened this issue May 7, 2016 · 0 comments
Open

Comments

@vadimkantorov
Copy link

If one of threads in the pool fails to reach the main loop (https://github.com/torch/threads/blob/master/threads.lua#L70) because of failed memory allocations, the thread pool does not notice it and tries to remove all endcallbacks from the queue in the synchronize(...) call https://github.com/torch/threads/blob/master/threads.lua#L258 which leads to a hang.

As a solution, one could split the code executed on threads in two parts: one is initialization, the other is the main loop; and one would check next if any threads failed to execute the initialization part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant