Skip to content

atomic_fork_group - to fork/join from different threads #258

@tzcnt

Description

@tzcnt

Currently fork_group has non-atomic counters. This is optimal for performance when fork and join are from the same task, but it's not safe to fork on multiple tasks/threads simultaneously, or fork on a different task from the join task without synchronization, if those tasks might run on different threads.

A fully atomic version should support these use-cases:

  • Task trees where inner tasks create forked tasks that the root can await.
  • A safer version of detach() / post() that allows creating background tasks at various times in the application, and waiting for them to complete before shutdown.

Maybe support:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions