Skip to content

Use of fork instead of spawn creates potential for hangs #281

@apontzen

Description

@apontzen

Currently the multiprocessing backend uses 'fork' rather than 'spawn' to launch processes.

This is helpful in that it carries over state related to which modules are imported, for example.

But, it is harmful in that threading state is not carried over. This is particularly problematic for OpenMP which maintains a thread-pool in the background. In the CI tests, executing the tests in some orders may lead to hangs due to pynbody's use of OpenMP. In normal runs, this doesn't occur because no OpenMP routines are called before the forks take place -- but still, there is potential for significant issues affect real use of tangos.

Probably the best way to resolve this is to move to 'spawn', rather than 'fork', but this will require some work to carry over the required state into the child processes.

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