diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-12-06 11:38:07 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-12-06 15:19:18 +0000 |
commit | 8b75acd3ca25165536f18976c8d80cb62ad613e4 (patch) | |
tree | ccb87f6f5df2af15ca2ca8f65e5163b1f34886b8 /rts/Capability.h | |
parent | 657773c8e59917fda05ee08065ec566aebb50a5f (diff) | |
download | haskell-8b75acd3ca25165536f18976c8d80cb62ad613e4.tar.gz |
Make forkProcess work with +RTS -N
Consider this experimental for the time being. There are a lot of
things that could go wrong, but I've verified that at least it works
on the test cases we have.
I also did some API cleanups while I was here. Previously we had:
Capability * rts_eval (Capability *cap, HaskellObj p, /*out*/HaskellObj *ret);
but this API is particularly error-prone: if you forget to discard the
Capability * you passed in and use the return value instead, then
you're in for subtle bugs with +RTS -N later on. So I changed all
these functions to this form:
void rts_eval (/* inout */ Capability **cap,
/* in */ HaskellObj p,
/* out */ HaskellObj *ret)
It's much harder to use this version incorrectly, because you have to
pass the Capability in by reference.
Diffstat (limited to 'rts/Capability.h')
-rw-r--r-- | rts/Capability.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/rts/Capability.h b/rts/Capability.h index 1957487329..033806b3be 100644 --- a/rts/Capability.h +++ b/rts/Capability.h @@ -199,10 +199,15 @@ extern Capability *capabilities; // extern Capability *last_free_capability; -// GC indicator, in scope for the scheduler -#define PENDING_GC_SEQ 1 -#define PENDING_GC_PAR 2 -extern volatile StgWord waiting_for_gc; +// +// Indicates that the RTS wants to synchronise all the Capabilities +// for some reason. All Capabilities should stop and return to the +// scheduler. +// +#define SYNC_GC_SEQ 1 +#define SYNC_GC_PAR 2 +#define SYNC_FORK 3 +extern volatile StgWord pending_sync; // Acquires a capability at a return point. If *cap is non-NULL, then // this is taken as a preference for the Capability we wish to |