WorksheetsIntroduction to Processes and Process Management
Total questions: 106
Worksheet time: 53mins
Which statement best defines a process in an operating system?
A sequence of source code files in storage
An instance of a program currently in execution
A hardware thread managed by the CPU directly
A static binary loaded but never scheduled
Which PCB field tracks the address of the next instruction to execute?
Process ID
Program Counter
I/O Status
Memory Management
A process is executing instructions and then needs to wait for disk I/O. What is the typical state transition?
Running → Ready
Running → Waiting
Ready → Suspended
Waiting → Terminated
Which combination lists attributes commonly stored in a Process Control Block?
Process ID identifier
CPU register contents
Open files and device info
Compiler optimization flags
User interface theme color
In the Ready state, what is the process primarily waiting for?
User input event to arrive
CPU allocation to begin execution
Memory to be swapped to disk
Termination signal from the kernel
Which state most accurately describes a process that has finished execution and is releasing resources?
Suspended
Terminated
Waiting
New
What typically triggers a transition from Ready to Running?
Completion of an I/O request
Scheduler dispatches CPU to the process
Arrival of a network packet
User presses a keyboard key
Which statements are true about the Suspended state?
Process temporarily inactive
Process removed from main memory
Process currently executing instructions
Process waiting on a semaphore
Process finished and releasing resources
Select the best description of the Waiting state.
Awaiting an event such as I/O or semaphore
Awaiting CPU after termination cleanup
Awaiting compilation before first run
Awaiting user login credentials
Scheduling in process management is responsible for which action?
Selecting the next process to run on the CPU
Compiling programs into machine code
Encrypting process address spaces
Rendering user interface windows
Which transition is commonly managed by the OS after an I/O completes?
Waiting → Ready
Ready → New
Terminated → Running
Running → Suspended
Which statement best defines a thread in computing?
A standalone program executing independently
A lightweight unit of execution within a process
A hardware core scheduling tasks autonomously
A background service isolated from all memory
Which characteristic distinguishes threads from processes regarding memory usage?
Threads share memory within their parent process
Threads allocate independent address spaces
Threads require dedicated physical memory banks
Threads swap to disk before sharing data
Compared to processes, thread creation time is typically
Longer and heavyweight
Similar across both units
Shorter and lightweight
Unpredictable and hardware-bound
In a process, multiple threads primarily benefit applications by
Increasing isolation between components
Reducing communication efficiency
Improving responsiveness through parallel work
Eliminating the need for synchronization
Which scenario exemplifies multithreading in a word processor?
One thread handles user input while another reformats
Each thread runs in separate address spaces
Threads cannot access shared document buffers
A single thread processes all user interface tasks
What is a key difference in communication between processes and threads?
Processes communicate via shared memory directly
Threads require inter-process communication mechanisms
Processes often require IPC, threads can share memory
Threads communicate only through network sockets
Context switching for threads compared to processes is generally
More time and expensive
Less time and faster
Equal time and overhead
Disabled on modern operating systems
Which statement about resource sharing is accurate for threads?
Threads share code, data, and resources of their parent
Threads cannot share file handles or caches
Threads share only CPU registers between them
Threads must copy data to communicate
Select the benefits commonly associated with threads.
Lightweight creation and switching
Improved communication via shared memory
Greater isolation for fault containment
Enhanced application responsiveness
Which application behavior in web browsers is enabled by multiple threads?
Isolating tabs into separate processes only
Parallel content loading and UI responsiveness
Disabling JavaScript to reduce contention
Single-threaded page rendering for consistency
Which statement correctly compares memory spaces of processes and threads?
Processes share memory by default within a program
Threads allocate new address spaces per creation
Processes have independent memory; threads share within process
Threads isolate memory to prevent race conditions
Termination time for threads relative to processes is typically
More time due to heavy cleanup
Less time due to lightweight state
Identical across both abstractions
Undefined and scheduler dependent
Which real-world example shows parallelism via threads without blocking the UI?
Spell checking runs within the only UI thread
Background document reformatting on a separate thread
User input and rendering in one combined thread
Network requests forced into process boundaries
In a multithreaded program, threads within the same process typically share
Heap, code segment, and open resources
Only CPU cores and no memory
Just the stack and registers
No runtime resources by design
Which factor contributes to smoother user experiences with threads?
Single-threaded execution hides latency
Parallel operations utilize multiple cores
Context switching increases overhead drastically
Thread isolation prevents resource sharing
Which misconception about threads is incorrect?
Threads are heavier than processes to create
Threads share memory space of the parent process
Threads enable parallel tasks within one process
Threads can improve responsiveness of applications
When designing for communication efficiency within a program, choosing threads over processes can be beneficial because
Threads use IPC channels exclusively
Threads directly access shared memory structures
Threads forbid synchronization primitives
Threads require network stacks for messaging
Which comparison best summarizes the key takeaway?
Processes share resources for maximum efficiency
Threads isolate environments to reduce overhead
Processes are isolated with more overhead; threads share resources
Threads require IPC while processes share memory directly
Which statement best defines Inter-Process Communication (IPC)?
Techniques for processes to communicate and coordinate
Methods for compiling code into machine language
Protocols for networking between remote computers
Strategies for encrypting files on local storage
In the diagram showing Process A and Process B, what does the IPC channel enable between processes?
Data exchange and control coordination
Exclusive CPU scheduling decisions
Direct disk block allocation sharing
Automatic cache coherence across cores
Which are the two main IPC mechanisms highlighted?
Shared memory
Message passing
Remote procedure calls
Memory-mapped files
What is a key requirement when using shared memory for IPC?
Synchronization to avoid data corruption
Kernel-only access to memory pages
Mandatory encryption for all writes
Network sockets for every process
Which characteristic primarily explains why shared memory is fast?
Direct access without repeated data copying
Asynchronous signals processed by kernel
Priority scheduling for cooperating threads
Compression of payloads before writing
Which risk is inherent to shared memory when multiple processes access it?
Data corruption without proper coordination
Dead network links causing packet loss
GPU contention reducing frame rates
File handle leaks in persistent storage
Which synchronization primitive is commonly used with shared memory to coordinate access?
Semaphores controlling critical sections
DNS records resolving hostnames
Checksum algorithms verifying integrity
Paging algorithms swapping frames
In shared memory IPC, which statement about efficiency is accurate?
It eliminates overhead of inter-address copying
It increases kernel context switch overhead
It requires serializing data into messages
It depends on network throughput entirely
Which statement correctly describes message passing?
Processes exchange messages via kernel channels
Processes write directly into shared buffers
Threads modify registers in another process
Programs poll hardware ports for signals
Compared to shared memory, why does message passing often have higher overhead?
Kernel involvement and buffer copying
Mandatory encryption and compression
Network routing across subnets
Frequent page table invalidations
Which advantage is associated with message passing regarding safety?
Eliminates risk of direct overwrites
Guarantees zero context switches
Prevents any deadlock conditions
Removes need for scheduling
During a send operation in message passing, what happens to the message?
Placed in destination process queue
Written into shared memory region
Executed by kernel as a syscall
Encoded into a hardware interrupt
Which pair best matches mechanism to typical trait?
Shared memory — direct memory access
Message passing — kernel-managed queues
Shared memory — heavy kernel mediation
Message passing — no data copying
Which scenario most benefits from shared memory over message passing?
High-throughput data sharing within one host
Unreliable networked communication across nodes
Event notifications requiring strict ordering
Rare, small messages between unrelated services
Which statement about synchronization in IPC is accurate?
Needed to coordinate and prevent conflicts
Optional because processes never overlap
Handled automatically by hardware caches
Only required for kernel threads
Which trade-off distinguishes shared memory from message passing?
Speed versus safety in data handling
Color depth versus frame timing
Bandwidth versus wireless latency
Storage capacity versus filesystem type
Which statement best distinguishes pipes from sockets in typical IPC use?
Pipes are bidirectional full-duplex channels
Pipes provide unidirectional data flow
Sockets only connect related parent-child processes
Sockets are limited to local machine only
In a client-server application requiring two-way communication across a network, which IPC mechanism fits best?
Anonymous pipes between processes
Named pipes for local filesystems
Bidirectional sockets with client-server
Signals for simple notifications
Which property makes sockets network-transparent?
Same API for local and remote endpoints
Automatic message queuing on the kernel
One-way communication semantics only
Treating data as shared memory block
Anonymous pipes are typically used for which scenario?
Connecting unrelated processes via filesystem
Connecting related processes like parent-child
Implementing remote procedure calls over WAN
Synchronizing access to mapped files
Named pipes (FIFOs) differ from anonymous pipes primarily because they
Support bidirectional full-duplex by default
Are treated like files in the filesystem
Are restricted to parent-child relationships
Provide network-transparent endpoints
Which characteristics are true of sockets in IPC? Select all that apply.
Bidirectional full-duplex communication
Common client-server architecture pattern
One-way data flow only
Same API for local and remote use
Message queues enable which behavior in process communication?
Synchronous blocking between sender and receiver
Asynchronous exchange with queued storage
Direct memory sharing without filesystem
Signal-based command notification only
Why might a developer prefer message queues over pipes in some designs?
Queues allow sender to proceed without waiting
Queues enforce strictly ordered synchronous reads
Queues only support local machine endpoints
Queues automatically perform remote procedure calls
Which statement about signals is accurate?
Signals carry large payloads for data transfer
Signals primarily notify or command processes
Signals implement transparent client-server RPC
Signals guarantee asynchronous queued delivery
Remote Procedure Calls (RPC) are best described as
Low-level byte stream connectors
High-level IPC invoking procedures remotely
Unidirectional notification mechanisms
File-based shared memory blocks
File mapping enables efficient sharing because it
Queues messages until receiver reads
Treats file contents as a memory block
Provides signal-based event dispatch
Forces full-duplex socket sessions
When multiple processes access a mapped file concurrently, what is required to avoid corruption?
Client-server negotiation via sockets
Kernel-enforced synchronous pipes
Application-level synchronization mechanisms
Signal-based retries with backoff
Which IPC mechanisms are inherently bidirectional? Select all that apply.
Anonymous pipes
Sockets with full-duplex capability
Signals sent between processes
RPC over network transports
Choose the most appropriate IPC for sending short control notifications with minimal data.
Full-duplex TCP sockets session
Message queue with persistent storage
Signal from one process to another
Memory-mapped file synchronization
Which statement best describes the critical section problem in concurrent systems?
Coordinating processes sharing resources to avoid inconsistency
Optimizing memory usage across independent program modules
Ensuring every thread completes within a fixed time slice
Scheduling tasks so processors remain at maximum utilization
What is the primary consequence of a race condition in shared data access?
Unpredictable results and inconsistent system behavior
Guaranteed faster execution of parallel processes
Reduced memory footprint for shared variables
Automatic priority boosting for blocked processes
Which requirement ensures only one process executes in the critical section at a time?
Mutual exclusion in critical section access
Progress among waiting entrants
Bounded waiting for queued processes
Fair scheduling of all threads
Which pair correctly matches a requirement with its intent when solving the critical section problem?
Mutual exclusion — prevent simultaneous critical execution
Progress — avoid indefinite postponement
Bounded waiting — limit maximum wait time
Deadlock — guarantee preemption of holders
Interleaved execution over shared memory primarily threatens which property?
Mutual exclusion during critical operations
Throughput of non-blocking pipelines
Cache coherence across multiple cores
Deterministic order of function calls
Which statement defines a semaphore in process synchronization?
An integer-based synchronization primitive controlling resource access
A hardware timer used to preempt long-running tasks
A message queue for asynchronous event delivery
A memory barrier ensuring instruction ordering
Semaphores ensure that only a permissible number of processes can use a resource at any time. What does the term permissible number imply?
A configured capacity reflected by the semaphore value
The maximum number of CPU cores available
The count of processes created by the scheduler
The number of threads in a single application
Which characteristics are core to semaphores? Select all that apply.
Operate via atomic operations
Prevent race conditions in shared access
Manage coordination and synchronization
Increase process execution speed automatically
In the diagram showing P1 and P2 approaching a semaphore guarding a resource, what happens when the semaphore value is one and both arrive?
One proceeds to the resource, the other waits
Both proceed concurrently to the resource
Both are permanently blocked from the resource
Neither is affected by the semaphore value
The wait operation (P) performs which action on the semaphore value?
Decrements the value and may block
Increments the value and unblocks
Reads the value without changing
Resets the value back to zero
During wait (P), when does a process become blocked?
When the semaphore value becomes negative
When another process signals immediately
When the CPU enters a low-power state
When shared memory pages are swapped
Which description correctly characterizes the signal operation (V)?
Increments the semaphore and unblocks one
Decrements the semaphore and blocks one
Leaves the semaphore unchanged and logs
Halts all waiting processes and resets
Match operations to their alternate names.
Wait — down operation
Signal — up operation
Wait — raise operation
Signal — lower operation
Why must semaphore operations be atomic?
To prevent race conditions during updates
To reduce cache misses on shared data
To maximize throughput of I/O devices
To allow speculative execution of threads
Which combination of properties collectively addresses the critical section problem?
Mutual exclusion
Progress
Bounded waiting
Starvation freedom by priority inheritance
A system uses a counting semaphore initialized to two protecting a printer pool. What behavior should you expect when three print jobs arrive simultaneously?
Two jobs start; one waits until signaled
All three jobs start immediately
One job starts; two are terminated
No job starts until all arrive
Which statement best describes how a binary semaphore enforces mutual exclusion in a critical section?
Allows one process at a time using wait and signal
Lets multiple processes enter until the queue empties
Blocks only I/O-bound processes from entering
Permits concurrent reads but serial writes only
A semaphore S initialized to 1 is used around a critical section. Which sequence correctly brackets the section?
wait(S) before, signal(S) after
signal(S) before, wait(S) after
wait(S) twice around code
signal(S) twice around code
In the diagram of mutual exclusion in action, what does the dashed box around P1 indicate?
P1 is inside the critical section
P1 is blocked by the scheduler
P1 is waiting on a counting semaphore
P1 holds multiple resource instances
Which property distinguishes counting semaphores from binary semaphores?
Range can be 0 to N, not just {0,1}
They only protect single critical sections
They cannot be used for resource pools
They do not support wait and signal
Counting semaphores are most appropriate when managing which scenario?
Access to a pool of identical printers
A single shared variable update
A mutex around one critical path
Priority inversion avoidance only
Binary semaphore typical values and meaning are:
1 means free, 0 means busy
0 means free, 2 means busy
Positive means busy, negative free
Any nonzero means free always
Select all statements that correctly describe counting semaphores.
Used for multiple instances of a resource
Value represents available resource count
Limited strictly to values 0 or 1
Ideal for resource pool management
What risk do semaphores mitigate when protecting critical sections?
Race conditions between processes
Deadlocks caused by paging
Starvation due to CPU bursts
Thrashing from memory overuse
When S=3 for a counting semaphore governing database connections, what does the value represent?
Three connections available to acquire
Three processes currently inside
Semaphore is binary and locked
Zero resources remaining to use
Which pair correctly matches semaphore type to typical use case?
Binary — single critical section protection
Counting — managing resource pools
Binary — multiple identical resource instances
Counting — mutual exclusion of one code block
Which statement best defines a deadlock in operating systems?
Processes are paused for scheduled maintenance only
Two or more processes wait indefinitely for each other
A single process waits for a user input temporarily
Resources are freed automatically after short delays
In the traffic gridlock analogy, what concept is being illustrated?
Priority scheduling resolving collisions quickly
Mutual exclusion among car lanes only
Processes waiting for each other, none can proceed
Cars share lanes freely without constraints
Which condition describes mutual exclusion in deadlock theory?
Resources can be shared by all processes concurrently
Only one process can use a non-sharable resource at a time
Processes release resources before requesting new ones
Resources are forcibly taken when demand increases
Hold and wait is present when a process does what?
Holds at least one resource while requesting more
Releases all resources before requesting additional
Waits without holding any allocated resource
Preempts another process to acquire a resource
Which statement best captures no preemption?
Allocated resources cannot be forcibly taken back
Resources are preempted when priorities change
Processes must yield resources after time slices
Resources are shared in read-only mode by many
Circular wait occurs when which situation exists?
A process waits for itself to release a resource
Each process waits for a resource held by the next
All processes wait for the same single resource
Processes wait randomly without any fixed order
Which set lists all four necessary conditions for deadlock?
Mutual exclusion, hold and wait, preemption, starvation
Mutual exclusion, hold and wait, no preemption, circular wait
Race condition, resource sharing, no preemption, fairness
Priority inversion, mutual exclusion, aging, circular buffer
In a resource allocation graph showing a cycle among processes and resources, what does the cycle indicate?
Guaranteed avoidance using banker’s algorithm
Possible circular wait leading to deadlock
Temporary delay due to I/O buffering
Fair scheduling among competing processes
Which action would break hold and wait to prevent deadlocks?
Allow preemption of allocated resources
Require processes to request all resources at once
Convert non-sharable resources to sharable ones
Increase the number of identical resource instances
A system experiences all four necessary conditions simultaneously. What is the implication?
Deadlock is impossible but starvation likely
Deadlock must occur with certainty every time
Deadlock can occur; system is at risk
Processes will complete with longer wait times
Which strategy prevents deadlocks by requiring processes to request all needed resources simultaneously?
Hold and wait negation policy
Circular wait ordering rule
No preemption enforcement
Banker’s algorithm safety test
Deadlock prevention may reduce efficiency primarily because it does what to resource utilization?
Limits resource utilization levels
Increases parallel throughput
Maximizes CPU scheduling
Eliminates all I/O waiting
In a prevention scheme, imposing a total ordering on resource types addresses which condition of deadlock?
Circular wait condition
Mutual exclusion condition
Hold and wait condition
No preemption condition
Which approach checks whether a resource request keeps the system in a safe state before granting it?
Banker’s algorithm procedure
Process termination method
Wait-for graph cycle test
Resource preemption rule
Arrange the Banker’s Algorithm steps: a process declares maximum needs, the system checks safety, the request is granted if safe, otherwise the process waits.
Declare max, check safety, grant if safe, else wait
Grant request, declare max, check safety, else wait
Check safety, grant request, declare max, else wait
Declare max, grant request, check safety, else wait
Which statement about deadlock detection is accurate?
Systems periodically check for deadlocks
Detection eliminates mutual exclusion
Detection guarantees safe allocation
Detection replaces prevention entirely
In a Resource Allocation Graph, what typically indicates a deadlock has occurred?
Presence of a cycle in the graph
A single isolated resource node
All edges pointing to processes
No edges between resources
In a Wait-For Graph among processes, a cycle signifies what?
A deadlock among processes
A safe allocation state
Temporary starvation only
Priority inversion event
When a deadlock is detected, which recovery technique forces resources to be taken from processes?
Resource preemption method
Process migration action
Banker’s avoidance step
Priority aging scheme
Which recovery approach aborts all deadlocked processes, potentially impacting performance?
Process termination strategy
Deferred detection routine
Circular wait elimination
Safety sequence computation
Which considerations commonly influence recovery decisions after detection?
System performance impact
Process priority levels
Network bandwidth quotas
User interface consistency
