Commit 6e817437 authored by simonmar's avatar simonmar
Browse files

[project @ 2004-02-27 12:39:16 by simonmar]

scheduleWaitThread(): don't call THREAD_RUNNABLE because the new
thread is bound, and therefore only runnable by the current OS
thread.  Calling THREAD_RUNNABLE just wakes up workers and slows
things down.
parent 0effbe4b
/* ---------------------------------------------------------------------------
* $Id: Schedule.c,v 1.188 2004/02/26 16:19:32 simonmar Exp $
* $Id: Schedule.c,v 1.189 2004/02/27 12:39:16 simonmar Exp $
*
* (c) The GHC Team, 1998-2003
*
......@@ -1952,21 +1952,12 @@ void
scheduleThread_(StgTSO *tso)
{
// Precondition: sched_mutex must be held.
/* Put the new thread on the head of the runnable queue. The caller
* better push an appropriate closure on this thread's stack
* beforehand. In the SMP case, the thread may start running as
* soon as we release the scheduler lock below.
*/
PUSH_ON_RUN_QUEUE(tso);
THREAD_RUNNABLE();
#if 0
IF_DEBUG(scheduler,printTSO(tso));
#endif
}
void scheduleThread(StgTSO* tso)
void
scheduleThread(StgTSO* tso)
{
ACQUIRE_LOCK(&sched_mutex);
scheduleThread_(tso);
......@@ -2014,7 +2005,10 @@ scheduleWaitThread(StgTSO* tso, /*[out]*/HaskellObj* ret,
m->link = main_threads;
main_threads = m;
scheduleThread_(tso);
PUSH_ON_RUN_QUEUE(tso);
// NB. Don't call THREAD_RUNNABLE() here, because the thread is
// bound and only runnable by *this* OS thread, so waking up other
// workers will just slow things down.
return waitThread_(m, initialCapability);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment