Interview Questions :: Operating Systems
2. What is a binary semaphore? What is its use?
3. Explain Belady’s Anomaly?
4. List the Coffman’s conditions that lead to a deadlock.
- Mutual Exclusion: Only one process may use a critical resource at a time.
- Hold & Wait: A process may be allocated some resources while waiting for others.
- No Pre-emption: No resource can be forcible removed from a process holding it.
- Circular Wait: A closed chain of processes exist such that each process holds at least one resource needed by another process in the chain.
5. What are short, long and medium-term scheduling?
Long term scheduler determines which programs are admitted to the system for processing. It controls the degree of multiprogramming. Once admitted, a job becomes a process.
Medium term scheduling is part of the swapping function. This relates to processes that are in a blocked or suspended state. They are swapped out of real-memory until they are ready to execute. The swapping-in decision is based on memory-management criteria.
Short term scheduler, also know as a dispatcher executes most frequently, and makes the finest-grained decision of which process should execute next. This scheduler is invoked whenever an event occurs. It may lead to interruption of one process by preemption.
6. What are turnaround time and response time?
7. Explain the popular multiprocessor thread-scheduling strategies.
- Load Sharing: Processes are not assigned to a particular processor. A global queue of threads is maintained. Each processor, when idle, selects a thread from this queue. Note that load balancing refers to a scheme where work is allocated to processors on a more permanent basis.
- Gang Scheduling: A set of related threads is scheduled to run on a set of processors at the same time, on a 1-to-1 basis. Closely related threads / processes may be scheduled this way to reduce synchronization blocking, and minimize process switching. Group scheduling predated this strategy.
- Dedicated processor assignment: Provides implicit scheduling defined by assignment of threads to processors. For the duration of program execution, each program is allocated a set of processors equal in number to the number of threads in the program. Processors are chosen from the available pool.
- Dynamic scheduling: The number of thread in a program can be altered during the course of execution.
8. What are local and global page replacements?
9. Define latency, transfer and seek time with respect to disk I/O.
12. What are demand-paging and pre-paging?