Skip to content

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

@vadimkantorov

Description

@vadimkantorov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions