What is context switching?
- Context is associated with each process encompassing all the information describing the current execution state of the process
- When the OS saves the context of program that is currently running and restores the context of the next ready to run process, it is called as context switching.
- It is important for multitasking OS.
Tell us something about Mutex.
- Mutex - ‘Mutual Exclusion Lock’ is a lock which protects access to shared data resource.
- Threads can create and initialize a mutex to be used later.
- Before entering a critical region the mutex is locked. It is unlocked after exiting the critical region. If any thread tries to lock the mutex during this time, it can't do so.
Post a Comment