From 7effbbbbdfe7eb05c6402fa9337e358e7e9fadde Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 9 Mar 2010 14:31:11 +0000 Subject: Split part of the Task struct into a separate struct InCall The idea is that this leaves Tasks and OSThread in one-to-one correspondence. The part of a Task that represents a call into Haskell from C is split into a separate struct InCall, pointed to by the Task and the TSO bound to it. A given OSThread/Task thus always uses the same mutex and condition variable, rather than getting a new one for each callback. Conceptually it is simpler, although there are more types and indirections in a few places now. This improves callback performance by removing some of the locks that we had to take when making in-calls. Now we also keep the current Task in a thread-local variable if supported by the OS and gcc (currently only Linux). --- rts/Schedule.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'rts/Schedule.h') diff --git a/rts/Schedule.h b/rts/Schedule.h index 6751144be8..af322d804f 100644 --- a/rts/Schedule.h +++ b/rts/Schedule.h @@ -46,15 +46,8 @@ StgWord raiseExceptionHelper (StgRegTable *reg, StgTSO *tso, StgClosure *excepti /* findRetryFrameHelper */ StgWord findRetryFrameHelper (StgTSO *tso); -/* workerStart() - * - * Entry point for a new worker task. - * Called from STG : NO - * Locks assumed : none - */ -#if defined(THREADED_RTS) -void OSThreadProcAttr workerStart(Task *task); -#endif +/* Entry point for a new worker */ +void scheduleWorker (Capability *cap, Task *task); /* The state of the scheduler. This is used to control the sequence * of events during shutdown, and when the runtime is interrupted -- cgit v1.2.1