summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2020-04-20 16:40:42 +0200
committerBen Gamari <ben@smart-cactus.org>2020-07-15 16:41:02 -0400
commitcc5d7bb1dcf5603ac47320e83e4fc9ef53e409e9 (patch)
tree11daeccc9c18522b727e890179649ccf5c8ebd7f /rts
parentf47c7208c31bdd695ba46e6bdf4a349ae46c79bc (diff)
downloadhaskell-cc5d7bb1dcf5603ac47320e83e4fc9ef53e409e9.tar.gz
winio: Queue IO processing threads at the front of the queue.
This will unblock the IO thread sooner hopefully leading to higher throughput in some situations.
Diffstat (limited to 'rts')
-rw-r--r--rts/Schedule.c8
-rw-r--r--rts/Schedule.h4
-rw-r--r--rts/win32/AsyncWinIO.c2
3 files changed, 13 insertions, 1 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 8c120c093e..6b10326859 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -2577,6 +2577,14 @@ scheduleThread(Capability *cap, StgTSO *tso)
}
void
+scheduleThreadNow(Capability *cap, StgTSO *tso)
+{
+ // The thread goes at the *beginning* of the run-queue,
+ // in order to execute it as soon as possible.
+ pushOnRunQueue(cap,tso);
+}
+
+void
scheduleThreadOn(Capability *cap, StgWord cpu USED_IF_THREADS, StgTSO *tso)
{
tso->flags |= TSO_LOCKED; // we requested explicit affinity; don't
diff --git a/rts/Schedule.h b/rts/Schedule.h
index 89ab6e0b4c..a550a6763a 100644
--- a/rts/Schedule.h
+++ b/rts/Schedule.h
@@ -27,6 +27,10 @@ void markScheduler (evac_fn evac, void *user);
// Place a new thread on the run queue of the current Capability
void scheduleThread (Capability *cap, StgTSO *tso);
+// Place a new thread on the run queue of the current Capability
+// at the front of the queue.
+void scheduleThreadNow (Capability *cap, StgTSO *tso);
+
// Place a new thread on the run queue of a specified Capability
// (cap is the currently owned Capability, cpu is the number of
// the desired Capability).
diff --git a/rts/win32/AsyncWinIO.c b/rts/win32/AsyncWinIO.c
index 6bacf48eb1..a280c28bde 100644
--- a/rts/win32/AsyncWinIO.c
+++ b/rts/win32/AsyncWinIO.c
@@ -426,7 +426,7 @@ bool queueIOThread()
StgTSO * tso = createStrictIOThread (cap, RtsFlags.GcFlags.initialStkSize,
processRemoteCompletion_closure);
ASSERT(tso);
- scheduleThread (cap, tso);
+ scheduleThreadNow (cap, tso);
result = true;
}
ReleaseSRWLockExclusive (&lock);