Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,391
    • Issues 4,391
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 372
    • Merge Requests 372
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #1048

Closed
Open
Opened 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
Assignee
Assign to
6.10 branch
Milestone
6.10 branch
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#1048