Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • E emper
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 15
    • Issues 15
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • i4i4
  • manycore
  • emper
  • Merge requests
  • !140

Draft: Introduce and use emper::exit

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Florian Fischer requested to merge aj46ezos/emper:emper_exit into master Mar 22, 2021
  • Overview 0
  • Commits 4
  • Pipelines 8
  • Changes 29

Calling exit(3) from within the runtime is racy because some worker
threads could hold references to resources which are freed by the thread
calling exit(3).

To solve this problem the new functions emper::exit(int) and emper_exit(int)
are introduced which initiate the termination of the runtime and exit
the current worker thread.

We have to ensure that no worker thread is using resources that are owned and
freed by other threads. This is done with a Latch that the workers use to synchronize before actually terminating.

The exit status specified by the worker thread is propagated to the
thread calling Runtime::waitUntilFinished which will call exit(3) with
the worker provided status.

Fixes #14 (closed).

Edited Apr 01, 2021 by Florian Fischer
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: emper_exit