Double scheduler queue to prevent CPU bound threads to lock the kernel #21
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A malicious or CPU bound thread with never perform syscalls will always be rescheduled when preempted, thus will never allow the scheduler to asynchronously return and stoping the executor from running other tasks.
Add a second thread queue to the scheduler to hold already scheduled threads.
The scheduler will then schedule the threads by batch:
- Schedule a thread from the ready queue
- When preempted, push the threadId to the scheduled queue
- Continue until the ready queue is empty
- Once the ready queue is emptied the executor can schedule other async tasks
- On the next timer interrupt, refill the ready queue with the scheduled queue
- Scheduler can now run user threads again