diff options
author | Dylan Yudaken <dylany@fb.com> | 2020-10-06 13:42:22 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-10-17 22:02:50 -0400 |
commit | 50e9df49b7cd637c4552ab34bf629a01af4767c0 (patch) | |
tree | 15576b62a40dbb4bbf6ca58bc6afab6e4ff9e732 /includes | |
parent | 451455fd008500259f5d2207bdfdccf6dddb52c5 (diff) | |
download | haskell-50e9df49b7cd637c4552ab34bf629a01af4767c0.tar.gz |
When using rts_setInCallCapability, lock incall threads
This diff makes sure that incall threads, when using `rts_setInCallCapability`, will be created as locked.
If the thread is not locked, the thread might end up being scheduled to a different capability.
While this is mentioned in the docs for `rts_setInCallCapability,`, it makes the method significantly less useful as there is no guarantees on the capability being used.
This commit also adds a test to make sure things stay on the correct capability.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/RtsAPI.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h index 3cf02c0d8a..055b17004d 100644 --- a/includes/RtsAPI.h +++ b/includes/RtsAPI.h @@ -374,10 +374,6 @@ Capability *rts_unsafeGetMyCapability (void); // into Haskell. The actual capability will be calculated as the supplied // value modulo the number of enabled Capabilities. // -// Note that the thread may still be migrated by the RTS scheduler, but that -// will only happen if there are multiple threads running on one Capability and -// another Capability is free. -// // If affinity is non-zero, the current thread will be bound to // specific CPUs according to the prevailing affinity policy for the // specified capability, set by either +RTS -qa or +RTS --numa. @@ -479,6 +475,10 @@ void rts_evalLazyIO_ (/* inout */ Capability **, /* in */ unsigned int stack_size, /* out */ HaskellObj *ret); +void rts_inCall (/* inout */ Capability **, + /* in */ HaskellObj p, + /* out */ HaskellObj *ret); + void rts_checkSchedStatus (char* site, Capability *); SchedulerStatus rts_getSchedStatus (Capability *cap); |