cvs commit: fptools/ghc/includes TSO.h fptools/ghc/rts Exception.h
simonmar at glass.cse.ogi.edu
Mon Mar 1 06:18:36 EST 2004
simonmar 2004/03/01 06:18:36 PST
ghc/rts Exception.h Schedule.c Schedule.h
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
Revision Changes Path
1.34 +10 -11 fptools/ghc/includes/TSO.h
1.8 +3 -1 fptools/ghc/rts/Exception.h
1.193 +90 -148 fptools/ghc/rts/Schedule.c
1.45 +3 -4 fptools/ghc/rts/Schedule.h
More information about the Cvs-ghc