Changes between Version 6 and Version 7 of scheduler
- Timestamp:
- Aug 29, 2017, 3:20:12 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
scheduler
v6 v7 21 21 A thread generally enter in the BLOCKED state, when a given resource is not available, by calling the thread_block() function that set the relevant bit in the <blocked> bit-vector. It returns to the READY state when another thread releases the blocking resource, and call the thread_unblock() function, that reset the relevant bit. The thread_unblock() function can be called by any thread running in any cluster. 22 22 23 This simple blocking / unblocking mechanism is well suited to the Multi-Kernel-Hybrid architecture, as it is uses simpleremote_write accesses.23 This simple blocking / unblocking mechanism is well suited to the Multi-Kernel-Hybrid architecture, as it uses simple local / remote_write accesses. 24 24 25 25 == C) Scheduling policy == 26 26 27 Each scheduler maintains two separate, circular, lists of threads: one list of KERNEL threads, and one list of USER threads. AKERNEL threads have a higher priority than the USER threads, and each list is handled with a round-robin priority. When the sched_yield() function is called to perform a context switch for a given core, it implement the following policy:27 Each scheduler maintains two separate, circular, lists of threads: one list of KERNEL threads, and one list of USER threads. The KERNEL threads have a higher priority than the USER threads, and each list is handled with a round-robin priority. When the sched_yield() function is called to perform a context switch for a given core, it implement the following policy: 28 28 1. It scan the KERNEL list to find a READY thread. It executes this KERNEL thread if found. 29 29 1. If no KERNEL thread is found, it scan the USER list to fin a READY thread. It executes this USER thread if found. 30 1. If there is no KERNEL thread and no USER thread (other than the calling thread), the calling thread continues execution. if possible.30 1. If there is no KERNEL thread and no USER thread (other than the calling thread), the calling thread continues execution. 31 31 1. If there is no READY thread, it executes the IDLE thread. 32 32 33 The kernel has the possibility to force the selection of a given thread, identified by the sched_yield() function argument. This is used to reduce the latency of the RPCs. 33 The kernel has the possibility to force the selection of a given thread, identified by the sched_yield() function argument. This is used to reduce the RPC latency, using an IPI (Inter-Processor-Interrupt) to force 34 a context switch on a given remote core, and force execution of the relevant RPC thread.. 34 35 35 36 == D. Delayed Context Switches ==