NEW
Font size
WorksheetsPRE TEST_OS_MIDTERMS
Total questions: 40
Worksheet time: 20mins
What is a fundamental element of CPU utilization?
Process
Thread
Program
Task
Which of the following is NOT an attribute of a thread?
Thread execution state
Base priority
Process ID
Execution stack
In which operating system can a process define a specific address space with multiple threads?
MS-DOS
Windows
Java runtime environment
Classic UNIX
What is the main function of thread synchronization?
To increase CPU speed
To prevent interference between threads
To manage memory allocation
To enhance user interface
Which thread operation occurs when a thread needs to wait for an event?
Spawn
Block
Unblocked
Finish
What is a unique identifier for a thread called?
Process ID
Thread ID
Session ID
User ID
Which of the following is an advantage of user-level threads?
They require kernel mode for switching
They can be scheduled by the kernel
They can run on any OS without kernel changes
They cannot switch context efficiently
What does a thread's context contain?
Only the thread ID
Processor register values and volatile data
Static storage only
Only memory allocation information
In a combined approach to thread management, what happens to multiple user-level threads?
They are managed entirely by the kernel
They are mapped onto specific kernel-level threads
They cannot run simultaneously
They use individual memory spaces
Which state indicates that a thread is ready to execute but not currently running?
Blocked
Running
Suspended
Ready
What does the 'suspension count' of a thread indicate?
The total execution time
How many times a thread has been blocked
The number of times a thread has been suspended
The thread's priority level
What is a key characteristic of multithreading?
High memory overhead
Increased crash resilience
Faster communication within processes
Increased time for resource allocation
Which is NOT a benefit of multithreaded programming?
Responsiveness
Resource Sharing
Increased complexity
Scalability
What happens to all threads of a process if the process is swapped out?
Only the main thread is swapped
All threads remain active
All threads are automatically swapped out
Only user-level threads are affected
Which of the following operating systems supports multithreading?
MS-DOS
Windows
Classic UNIX
None of the above
What operation marks the completion of a thread's execution?
Block
Finish
Unblocked
Spawn
In kernel-level threading, who performs thread management?
The application
The operating system kernel
The user
The hardware
What type of thread management allows scheduling algorithms tailored for specific applications?
Kernel-Level Threads
User-Level Threads
Combined Approach
Lightweight Processes
Which attribute of a Windows thread allows it to perform operations on behalf of another process?
Thread context
Impersonation token
Thread execution time
Termination port
What is the primary reason for using multithreading in applications?
To consume more memory
To improve application responsiveness
To complicate the programming structure
To reduce CPU usage
What is the primary focus of operating system designs?
Memory Management
Process and Thread Management
User Interface Design
File System Management
Which of the following describes multiprogramming?
Management of multiple processes in a multiprocessor
Management of multiple processes in a uniprocessor system
Management of multiple distributed processes
Management of a single process with multiple threads
What is mutual exclusion?
Allowing multiple processes to access resources
Preventing one process from accessing resources while another is using them
Enabling resource sharing among processes
Allowing indefinite waiting for resource access
Which condition is NOT a requirement for mutual exclusion?
No deadlock or starvation
One process in the critical section at a time
Processes can be of varying speeds
Processes must always finish in a finite time
What does a critical section refer to?
A part of the operating system's kernel
A section of code needing access to shared resources
A type of semaphore
An atomic operation
What is a race condition?
When processes run simultaneously without sharing resources
A situation where the outcome depends on the timing of thread execution
A type of deadlock
A method for managing resources
In which situation do independent processes interact?
Cooperation by sharing
Competition
Cooperation by communication
Direct awareness
What is a counting semaphore used for?
To signal multiple processes
To lock access to resources
To monitor process execution
To manage user sessions
What is deadlock?
A temporary pause in process execution
A permanent blocking of processes waiting for resources
A type of race condition
An efficient resource allocation method
Which of the following is a condition for deadlock to occur?
Preemption of resources
Mutual exclusion
Shared resources
Resource abundance
What is a binary semaphore?
A semaphore that takes multiple values
A semaphore that takes only values 0 and 1
A semaphore that allows resource preemption
A complex synchronization mechanism
How can deadlocks be prevented?
By allowing unlimited resource requests
By implementing strict resource allocation protocols
By requiring all resources to be requested at once
By ignoring mutual exclusion
What is the primary method of deadlock avoidance?
Granting resources without checks
Denying resource requests that may lead to deadlock
Always allowing processes to run indefinitely
Randomly aborting processes
What does a resource allocation graph illustrate?
The speed of processes
The relationship between processes and resources
The memory usage of processes
The operating system's performance metrics
Which mechanism can be used to block a thread until a condition is met?
Semaphore
Mutex
Condition Variable
Spinlock
What is starvation in the context of process scheduling?
A process receiving resources too quickly
A runnable process that is overlooked indefinitely
A condition of high resource availability
A successful execution of a process
Which method is commonly used for deadlock detection?
Periodic resource checks
Immediate resource denial
Ignoring resource requests
Allowing processes to run indefinitely
What is the least common method for recovering from deadlocks?
Aborting all deadlocked processes
Backing up each deadlocked process
Allowing processes to continue executing
Preempting resources from deadlocked processes
What is the purpose of a monitor in concurrent programming?
To encapsulate variables and access procedures
To track process execution time
To provide unlimited access to shared resources
To manage CPU scheduling
What is an atomic operation?
An operation that can be interrupted by other processes
An indivisible operation that appears to execute as a single step
A lengthy operation that can take multiple cycles
An operation that is always executed in parallel
