Basic Operating System Concepts. A Review. Main Goals of OS. Resource Management: Disk, CPU cycles, etc. must be managed efficiently to maximize overall system performance Resource Abstraction: Software interface to simplify use of hardware resources
Basic Operating System Concepts
Operational concepts that allow the operating system to maintain control and protection.
Based on hardware features.
wait for event
Multi programming: Multiprogramming is the technique of running several programs at a time. Multiprogramming creates logical parallelism. The OS keeps several jobs in memory simultaneously. It selects a job from the job pool and starts executing it. When that job needs to wait for any i/o operation the CPU is switched to another job. So the main idea here is that the CPU is never idle.
Multi tasking: Multitasking is the logical extension of multiprogramming. After a certain amount of time the CPU is switched to another job. The difference is that the switching between jobs occurs so frequently that the users can interact with each program while it is running. This concept is also known as time-sharing.
Sometimes the two terms are used interchangeably.
Multiprocessing: involves multiple processors
Process A: A1, A2, A3, A4, A5, A6, A7, A8, …, Am
Process B: B1, B2, B3, B4, B5, B6, …, Bn
I: A1, A2, A3, A4, A5, …, Am, B1, B2, B3, B4, B5, B6, …, Bn
II: B1, B2, B3, B4, B5, A1, A2, A3, B6, …, Bn, A4, A5, …
III: A1, A2, B1, B2, B3, A3, A4, B4, B5, …, Bn, A5, A6, …, Am
Assume S is a semaphore
Enforcing Mutual Exclusion with Semaphores
semaphore mutex = 1;
Process 2. . .
P(mutex) execute critical sectionV(mutex)
Process 1 . . . P(mutex) execute critical sectionV(mutex)
P1 waits for resource owned by P2
P2 waits for resource owned by P1
Creation of Memory Fragments
End of OS Review