X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FSchedule.h;h=da4a01022683287bdf2ef76b838750bc053ced1b;hb=ff374b57fde43d3ef4e2449be631c7a8bafc68fe;hp=cf49a78612c434c137fd6a837173031b3e2aaccf;hpb=af13609607da81e7837a7c7c598de82452363ab5;p=ghc-hetmet.git diff --git a/ghc/rts/Schedule.h b/ghc/rts/Schedule.h index cf49a78..da4a010 100644 --- a/ghc/rts/Schedule.h +++ b/ghc/rts/Schedule.h @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Schedule.h,v 1.37 2003/01/25 15:54:50 wolfgang Exp $ + * $Id: Schedule.h,v 1.41 2003/10/01 10:57:43 wolfgang Exp $ * * (c) The GHC Team 1998-1999 * @@ -90,6 +90,14 @@ rtsBool wakeUpSleepingThreads(nat); /* In Select.c */ */ void wakeBlockedWorkerThread(void); /* In Select.c */ +/* resetWorkerWakeupPipeAfterFork() + * + * Notify Select.c that a fork() has occured + * + * Called from STG : NO + * Locks assumed : don't care, but must be called right after fork() + */ +void resetWorkerWakeupPipeAfterFork(void); /* In Select.c */ /* GetRoots(evac_fn f) * @@ -149,9 +157,11 @@ extern nat rts_n_waiting_workers; extern nat rts_n_waiting_tasks; #endif -StgInt forkProcess(StgTSO *tso); +StgBool rtsSupportsBoundThreads(void); +StgBool isThreadBound(StgTSO *tso); +StgInt forkProcess(HsStablePtr *entry); -extern SchedulerStatus rts_mainEvalIO(HaskellObj p, /*out*/HaskellObj *ret); +extern SchedulerStatus rts_mainLazyIO(HaskellObj p, /*out*/HaskellObj *ret); /* Called by shutdown_handler(). */ @@ -166,11 +176,13 @@ void resurrectThreads( StgTSO * ); * * These are the threads which clients have requested that we run. * - * In a 'threaded' build, we might have several concurrent clients all - * waiting for results, and each one will wait on a condition variable - * until the result is available. + * In a 'threaded' build, each of these corresponds to one bound thread. + * The pointer to the StgMainThread is passed as a parameter to schedule; + * this invocation of schedule will always pass this main thread's + * bound_thread_cond to waitForkWorkCapability; OS-thread-switching + * takes place using passCapability. * - * In non-SMP, clients are strictly nested: the first client calls + * In non-threaded builds, clients are strictly nested: the first client calls * into the RTS, which might call out again to C with a _ccall_GC, and * eventually re-enter the RTS. * @@ -186,10 +198,10 @@ typedef struct StgMainThread_ { SchedulerStatus stat; StgClosure ** ret; #if defined(RTS_SUPPORTS_THREADS) - Condition wakeup; #if defined(THREADED_RTS) - rtsBool thread_bound; Condition bound_thread_cond; +#else + Condition wakeup; #endif #endif struct StgMainThread_ *link; @@ -294,12 +306,12 @@ void labelThread(StgPtr tso, char *label); #if defined(RTS_SUPPORTS_THREADS) /* If no task is waiting for a capability, + * and if there is work to be done + * or if we need to wait for IO or delay requests, * spawn a new worker thread. - * - * (Used by the RtsAPI) */ void -startSchedulerTask(void); +startSchedulerTaskIfNecessary(void); #endif #endif /* __SCHEDULE_H__ */