Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Only a brain-damaged operating system would support task switching and not make the simple next step of supporting multitasking.

Rating
-
Sold
-
Pages
20
Grade
A+
Uploaded on
26-07-2025
Written in
2024/2025

Only a brain-damaged operating system would support task switching and not make the simple next step of supporting multitasking.

Institution
Course

Content preview

Interprocess Communication 12


“Only a brain-damaged operating system would support task switching and not make the simple next step of
supporting multitasking.”
– Calvin Keegan


Processes
• Abstraction of a running program
• Unit of work in the system
• Pseudoparallelism
• A process is traced by listing the sequence of instructions that execute for that process
• The process model
– Sequential Process/Task
∗ A program in execution
∗ Program code
∗ Current activity
∗ Process stack
· subroutine parameters
· return addresses
· temporary variables
∗ Data section
· Global variables
• Concurrent Processes
– Multiprogramming
– Interleaving of traces of different processes characterizes the behavior of the cpu
– Physical resource sharing
∗ Required due to limited hardware resources
– Logical resource sharing
∗ Concurrent access to the same resource like files
– Computation speedup
∗ Break each task into subtasks
∗ Execute each subtask on separate processing element
– Modularity
∗ Division of system functions into separate modules
– Convenience
∗ Perform a number of tasks in parallel
– Real-time requirements for I/O
• Process Hierarchies
– Parent-child relationship
– fork(2) call in Unix
– In ms-dos, parent suspends itself and lets the child execute
• Process states

,Interprocess Communication 13


– Running
– Ready (Not running, waiting for the CPU)
– Blocked / Wait on an event (other than cpu) (Not running)
– Two other states complete the five-state model – New and Exit
∗ A process being created can be said to be in state New; it will be in state Ready after it has been
created
∗ A process being terminated can be said to be in state Exit

Blocked


Event
I Event
@
occurs @ wait
  
@ 
Dispatch-
New - Ready  Running - Exit

   
Timeout




– Above model suffices for most of the discussion on process management in operating systems; however,
it is limited in the sense that the system screeches to a halt (even in the model) if all the processes are
resident in memory and they all are waiting for some event to happen
– Create a new state Suspend to keep track of blocked processes that have been temporarily kicked out of
memory to make room for new processes to come in
– The state transition diagram in the revised model is
 
Suspended Suspend
Blocked

 
@ Event
I Event
@
Activate
@ occurs @ wait
 
R
@ 
@ 
Dispatch-
New - Ready  Running - Exit
   
Timeout



– Which process to grant the CPU when the current process is swapped out?
∗ Preference for a previously suspended process over a new process to avoid increasing the total load
on the system
∗ Suspended processes are actually blocked at the time of suspension and making them ready will just
change their state back to blocked
∗ Decide whether the process is blocked on an event (suspended or not) or whether the process has
been swapped out (suspended or not)
– The new state transition diagram is

Blocked
Suspended

Event
I@
@
Suspend Activate
occurs @@
 @ 
@
R
Ready
Blocked
Suspended
 
@ Event
I Event
@
Activate
@ occurs @ wait
 
R
@ 
@ 
Dispatch-
New - Ready  Running - Exit
   
Timeout

, Interprocess Communication 14


Process control
• Modes of execution
– OS execution vs user process execution
– OS may prevent execution of some instructions in user mode and allow them to be executed only in
privileged mode (also called kernel mode, system mode, or control mode)
∗ Read/write a control register, such as psw
∗ Primitive I/O and memory management
– The two modes protect the OS data structures from interference by user code
– Kernel mode provides full control of the system that may not be needed for user programs
– The kernel mode can be entered by setting a bit in the psw
– The system can enter privileged mode as a result of a request from user code and returns to user mode
after completing the request
• Implementation of processes
– Process table
∗ One entry for each process
∗ program counter
∗ stack pointer
∗ memory allocation
∗ open files
∗ accounting and scheduling information
– Interrupt vector
∗ Contains address of interrupt service procedure
· saves all registers in the process table entry
· services the interrupt
• Process creation
– Assign a unique process identifier to the new process; add this process to the system process table that
contains one entry for each process
– Allocate space for all elements of process image – space for code, data, and user stack; values can be set
by default or based on parameters entered at job creation time
– Allocation of resources (CPU time, memory, files) – use either of the following policies
∗ New process obtains resources directly from the OS
∗ New process constrained to share resources from a subset of the parent process
– Build the data structures that are needed to manage the process, especially process control block
– When is a process created? – job submission, login, application such as printing
– Static or dynamic process creation
– Initialization data (input)
– Process execution
∗ Parent continues to execute concurrently with its children
∗ Parent waits until all its children have terminated
• Process switching
– Interrupt a running process and assign control to a different process
– Difference between process switching and mode switching

Written for

Course

Document information

Uploaded on
July 26, 2025
Number of pages
20
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$9.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
NurseTutor01

Get to know the seller

Seller avatar
NurseTutor01 Chamberlain College of Nursing
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
11 months
Number of followers
0
Documents
513
Last sold
-
NurseTutor

I have solutions for following subjects: Nursing, Business, Accounting, statistics, chemistry, Biology and all other subjects. Nursing Being my main profession line, I have essential guides that are Almost A+ graded, I am a very friendly person: If you would not agreed with my solutions I am ready for refund

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions