X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FThreads.c;h=0dee734baa0edfc15903a437c5e191c266c33067;hb=fff1f6194c3c39de53cd645bda9865fb131b1c68;hp=7344134a7d5a0d54e6a1d6bc60aa66c7c8277842;hpb=83d563cb9ede0ba792836e529b1e2929db926355;p=ghc-hetmet.git diff --git a/rts/Threads.c b/rts/Threads.c index 7344134..0dee734 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -284,6 +284,19 @@ unblock: // we'll block again. tso->why_blocked = NotBlocked; appendToRunQueue(cap,tso); + + // We used to set the context switch flag here, which would + // trigger a context switch a short time in the future (at the end + // of the current nursery block). The idea is that we have just + // woken up a thread, so we may need to load-balance and migrate + // threads to other CPUs. On the other hand, setting the context + // switch flag here unfairly penalises the current thread by + // yielding its time slice too early. + // + // The synthetic benchmark nofib/smp/chan can be used to show the + // difference quite clearly. + + // cap->context_switch = 1; } /* ----------------------------------------------------------------------------