summaryrefslogtreecommitdiff
path: root/ghc/rts/Exception.h
diff options
context:
space:
mode:
authorsimonmar <unknown>2004-03-01 14:18:36 +0000
committersimonmar <unknown>2004-03-01 14:18:36 +0000
commita20ec0ced36bca7cd0594528922dbe31a6186eae (patch)
treef569e827cb7903e995e6aa63259bf13c1fc988dd /ghc/rts/Exception.h
parent07e22b02f96a06ca7186f773dfc7c08f478a6877 (diff)
downloadhaskell-a20ec0ced36bca7cd0594528922dbe31a6186eae.tar.gz
[project @ 2004-03-01 14:18:35 by simonmar]
Threaded RTS improvements: - Make the main_threads list doubly linked. Have threads remove themselves from this list when they complete, rather than searching for completed main threads each time around the scheduler loop. This removes an O(n) loop from the scheduler, but adds some new constraints (basically completed threads must remain on the run queue until dealt with, including threads which have been killed by an async exception). - Add a pointer from the TSO to the StgMainThread struct, for main threads. This avoids a number of places where we had to traverse the list of main threads to find the right one, including one place in the scheduler loop. Adding a field to a TSO is cheap. - taskStart: we should be resetting the startingWorkerThread flag in here. Not sure why we aren't; maybe this got lost at some point. - Use the BlockedOnCCall flags in the non-threaded RTS too. Q: what should happen if a thread does a foreign call which re-enters the RTS, and then sends an async exception to the original thread? Answer: it should deadlock, which it does in the threaded RTS, and this commit makes it do so in the non-threaded RTS too (see testsuite/tests/concurrent/should_run/conc040.hs).
Diffstat (limited to 'ghc/rts/Exception.h')
-rw-r--r--ghc/rts/Exception.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/ghc/rts/Exception.h b/ghc/rts/Exception.h
index 291ad20b6b..ea2222344a 100644
--- a/ghc/rts/Exception.h
+++ b/ghc/rts/Exception.h
@@ -1,5 +1,5 @@
/* -----------------------------------------------------------------------------
- * $Id: Exception.h,v 1.7 2003/11/12 17:49:07 sof Exp $
+ * $Id: Exception.h,v 1.8 2004/03/01 14:18:35 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
@@ -27,6 +27,8 @@ interruptible(StgTSO *t)
#endif
case BlockedOnDelay:
return 1;
+ // NB. Threaded blocked on foreign calls (BlockedOnCCall) are
+ // *not* interruptible. We can't send these threads an exception.
default:
return 0;
}