This week we covered scheduling, processes and C process APIs (fork, yield, etc). We learned about the relationship between parent and child processes and how they share memory space. We also learned about software threads and how they are functional execution units of processes.
With regard to the scheduling algorithms we were able to see how starvation could happen. For example, in a preemptive scheduling system with a simplistic shortest duration scheduler, as long as subsequent tasks have shorter durations, a longer task could starve. We were also able to see that scheduling algorithms necessarily make trade-offs. An algorithm like round robin buys us some level of fairness but it’s at the cost of longer turn around times. The shortest remaining time first algorithm cuts down on average response time but as I mentioned before, there is the risk of process starvation.
Lastly, we spent some time learning about limited direct execution where even though applications run on the CPU directly, they do not have access to all of the system's memory. We learned about user mode and kernel mode privileges. If an application wants to access hardware, it needs to initiate a system call that initiates a software trap. That allows kernel mode software modules to perform low level operations before returning control to the application. Context switches come with a time penalty since they require saving the CPU state to memory and restoring it when the task is complete. Still, it is worth it since limited direct execution makes systems more secure and stable by preventing bad actors from accessing sensitive areas of memory and preventing fault scenarios and bugs in code from putting the system in a fault state.
No comments:
Post a Comment