
#7606: Stride scheduling for Haskell threads with priorities ---------------------------------+------------------------------------------ Reporter: ezyang | Owner: ezyang Type: feature request | Status: new Priority: normal | Milestone: 7.8.1 Component: Runtime System | Version: 7.7 Keywords: | Os: Unknown/Multiple Architecture: Unknown/Multiple | Failure: None/Unknown Difficulty: Unknown | Testcase: Blockedby: | Blocking: Related: | ---------------------------------+------------------------------------------ Comment(by ezyang): Replying to [comment:2 simonpj]:
* What the goal of this change is.
The goal of the change is to allow Haskell programmers to change how frequently threads they create are being run; in case there are some threads that are important and should be run as frequently as possible, or threads are being created by an untrusted user who should not be allowed to thread-bomb the system.
* Roughly how the new scheduling algorithm achieves the goal.
* There seems to be something about priorities involved. Who sets
Stride scheduling operates by replacing our old doubly linked list run queue with a priority queue. The priorities are 'passes' which increment by their stride (computed based on their priority) every time they run; thus, a task with a low stride will run multiple times before their pass catches up. those priorities? The programmer? The runtime system? The priorities are set by the programmer using setTickets and related functions.
* What about priority inversion?
Without any change to priorities, scheduling behavior is intended to be identical to what it was previously. Priority inversion can occur when a thread blocks on another; this patch doesn't address that yet (though I've mentioned about how to do it for BLACKHOLES). -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7606#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler