47 lines
1.4 KiB
Plaintext
47 lines
1.4 KiB
Plaintext
For RidhaOs we will use Round Robin Scheduler to switch from thread to another.
|
|
For Context switch we follow these steps:
|
|
1. Save execution of the running thread.
|
|
2. Restore execution of the next ready thread.
|
|
|
|
For Kernel he will be manage :
|
|
- Thread Scheduling.
|
|
- Booting.
|
|
- Inter-thread communication.
|
|
- Synchronization.
|
|
|
|
Steps to implement RidhaOs:
|
|
1. Configure timebase (by Default use systick).
|
|
2. Create our Thread Control Block for Round Robin design.
|
|
|
|
For more information:
|
|
|
|
Scheduling Algorithm Optimization :
|
|
The Keys to have a good RTOS design you need:
|
|
- Maximize Throughput.
|
|
- Minimize Turnaround Time.
|
|
- Minimize Response Time.
|
|
- Maximize CPU Utilization.
|
|
- Minimize Scheduling Overhead.
|
|
|
|
Popular Scheduling Algorithm:
|
|
* First Come First Serve Scheduler (FCFSS):
|
|
- Task are executed on first come, first server basis.
|
|
- Non-preemptive.
|
|
- Its implementation is based on FIFO queue.
|
|
- Poor in performance as average wait time is high.
|
|
|
|
* Round Robin Scheduler (RRS):
|
|
- Preemptive.
|
|
- Employs time sharing, gives each thread a timeslice (quanta).
|
|
- When timesclice runs out OS preempts the thread.
|
|
|
|
* Weighted Round Robin Scheduler (WRRS):
|
|
- Preemptive.
|
|
- Employs time sharing, gives each thread a timeslice (quanta).
|
|
- If quanta runs out OS preempts the thread.
|
|
- Threads have unequal weight.
|
|
|
|
* Rate Monotonic Scheduler (RMS).
|
|
* Shortest Job First (SJF).
|
|
|