Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
c5b5811c
Commit
c5b5811c
authored
25 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-07-06 15:24:01 by simonmar]
Add a note about @raiseInThread@.
parent
e8876154
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/docs/users_guide/parallel.vsgml
+20
-0
20 additions, 0 deletions
ghc/docs/users_guide/parallel.vsgml
with
20 additions
and
0 deletions
ghc/docs/users_guide/parallel.vsgml
+
20
−
0
View file @
c5b5811c
...
...
@@ -85,6 +85,26 @@ isn't lost: the computation is suspended until required by another
thread. The memory used by the thread will be garbage collected if it
isn't referenced from anywhere else.
More generally, an arbitrary exception may be raised in any thread for
which we have a <tt/ThreadId/, with <tt/raiseInThread/:
<tscreen><verb>
raiseInThread :: ThreadId -> Exception -> IO ()
</verb></tscreen>
Actually <tt/killThread/ just raises the <tt/ThreadKilled/ exception
in the target thread, the normal action of which is to just terminate
the thread. The target thread will stop whatever it was doing (even
if it was blocked on an <tt/MVar/ or other computation) and handle the
exception.
The <tt/ThreadId/ for the current thread can be obtained with
<tt/myThreadId/:
<tscreen><verb>
myThreadId :: IO ThreadId
</verb></tscreen>
NOTE: if you have a @ThreadId@, you essentially have a pointer to the
thread itself. This means the thread itself can't be garbage
collected until you drop the @ThreadId@. This misfeature will
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment