Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,408
    • Issues 5,408
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 603
    • Merge requests 603
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #1048
Closed
Open
Issue created Dec 13, 2006 by ChrisKuklewicz@trac-ChrisKuklewicz

Add forkIO that starts in 'block' mode

The current forkIO starts in 'unblock' mode and the spawned thread can receive asynchronous exceptions (and die) before the passed (IO ()) action can start to run.

Even if the user tried (forkIO (block io)) the new thread can be killed before entering the scope of block.

Proposal: Add forkBlockedIO that spawns the new thread in a 'block' state. Alternative: Add forkInheritIO that spawns the new thread in the same block or unblock state as the parent thread is at the forkInheritIO call. Thus (forkBlockedIO = block . forkInheritIO) and (forkIO = unblock . forkInheritIO).

Work around: At the moment a fresh MVar can immediately be used by the parent to wait until the child has signaled that it is executing withing the scope of the block (or exception handler, etc).

This ought to also be extended to forkBlockedOS or forkInheritOS.

Trac metadata
Trac field Value
Version 6.6
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component libraries/base
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Multiple
Architecture Multiple
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking