wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

PRE TEST_OS_MIDTERMS

Total questions: 40

Worksheet time: 20mins

Name
Class
Date
1.

What is a fundamental element of CPU utilization?

a)

Process

b)

Thread

c)

Program

d)

Task

2.

Which of the following is NOT an attribute of a thread?

a)

Thread execution state

b)

Base priority

c)

Process ID

d)

Execution stack

3.

In which operating system can a process define a specific address space with multiple threads?

a)

MS-DOS

b)

Windows

c)

Java runtime environment

d)

Classic UNIX

4.

What is the main function of thread synchronization?

a)

To increase CPU speed

b)

To prevent interference between threads

c)

To manage memory allocation

d)

To enhance user interface

5.

Which thread operation occurs when a thread needs to wait for an event?

a)

Spawn

b)

Block

c)

Unblocked

d)

Finish

6.

What is a unique identifier for a thread called?

a)

Process ID

b)

Thread ID

c)

Session ID

d)

User ID

7.

Which of the following is an advantage of user-level threads?

a)

They require kernel mode for switching

b)

They can be scheduled by the kernel

c)

They can run on any OS without kernel changes

d)

They cannot switch context efficiently

8.

What does a thread's context contain?

a)

Only the thread ID

b)

Processor register values and volatile data

c)

Static storage only

d)

Only memory allocation information

9.

In a combined approach to thread management, what happens to multiple user-level threads?

a)

They are managed entirely by the kernel

b)

They are mapped onto specific kernel-level threads

c)

They cannot run simultaneously

d)

They use individual memory spaces

10.

Which state indicates that a thread is ready to execute but not currently running?

a)

Blocked

b)

Running

c)

Suspended

d)

Ready

11.

What does the 'suspension count' of a thread indicate?

a)

The total execution time

b)

How many times a thread has been blocked

c)

The number of times a thread has been suspended

d)

The thread's priority level

12.

What is a key characteristic of multithreading?

a)

High memory overhead

b)

Increased crash resilience

c)

Faster communication within processes

d)

Increased time for resource allocation

13.

Which is NOT a benefit of multithreaded programming?

a)

Responsiveness

b)

Resource Sharing

c)

Increased complexity

d)

Scalability

14.

What happens to all threads of a process if the process is swapped out?

a)

Only the main thread is swapped

b)

All threads remain active

c)

All threads are automatically swapped out

d)

Only user-level threads are affected

15.

Which of the following operating systems supports multithreading?

a)

MS-DOS

b)

Windows

c)

Classic UNIX

d)

None of the above

16.

What operation marks the completion of a thread's execution?

a)

Block

b)

Finish

c)

Unblocked

d)

Spawn

17.

In kernel-level threading, who performs thread management?

a)

The application

b)

The operating system kernel

c)

The user

d)

The hardware

18.

What type of thread management allows scheduling algorithms tailored for specific applications?

a)

Kernel-Level Threads

b)

User-Level Threads

c)

Combined Approach

d)

Lightweight Processes

19.

Which attribute of a Windows thread allows it to perform operations on behalf of another process?

a)

Thread context

b)

Impersonation token

c)

Thread execution time

d)

Termination port

20.

What is the primary reason for using multithreading in applications?

a)

To consume more memory

b)

To improve application responsiveness

c)

To complicate the programming structure

d)

To reduce CPU usage

21.

What is the primary focus of operating system designs?

a)

Memory Management

b)

Process and Thread Management

c)

User Interface Design

d)

File System Management

22.

Which of the following describes multiprogramming?

a)

Management of multiple processes in a multiprocessor

b)

Management of multiple processes in a uniprocessor system

c)

Management of multiple distributed processes

d)

Management of a single process with multiple threads

23.

What is mutual exclusion?

a)

Allowing multiple processes to access resources

b)

Preventing one process from accessing resources while another is using them

c)

Enabling resource sharing among processes

d)

Allowing indefinite waiting for resource access

24.

Which condition is NOT a requirement for mutual exclusion?

a)

No deadlock or starvation

b)

One process in the critical section at a time

c)

Processes can be of varying speeds

d)

Processes must always finish in a finite time

25.

What does a critical section refer to?

a)

A part of the operating system's kernel

b)

A section of code needing access to shared resources

c)

A type of semaphore

d)

An atomic operation

26.

What is a race condition?

a)

When processes run simultaneously without sharing resources

b)

A situation where the outcome depends on the timing of thread execution

c)

A type of deadlock

d)

A method for managing resources

27.

In which situation do independent processes interact?

a)

Cooperation by sharing

b)

Competition

c)

Cooperation by communication

d)

Direct awareness

28.

What is a counting semaphore used for?

a)

To signal multiple processes

b)

To lock access to resources

c)

To monitor process execution

d)

To manage user sessions

29.

What is deadlock?

a)

A temporary pause in process execution

b)

A permanent blocking of processes waiting for resources

c)

A type of race condition

d)

An efficient resource allocation method

30.

Which of the following is a condition for deadlock to occur?

a)

Preemption of resources

b)

Mutual exclusion

c)

Shared resources

d)

Resource abundance

31.

What is a binary semaphore?

a)

A semaphore that takes multiple values

b)

A semaphore that takes only values 0 and 1

c)

A semaphore that allows resource preemption

d)

A complex synchronization mechanism

32.

How can deadlocks be prevented?

a)

By allowing unlimited resource requests

b)

By implementing strict resource allocation protocols

c)

By requiring all resources to be requested at once

d)

By ignoring mutual exclusion

33.

What is the primary method of deadlock avoidance?

a)

Granting resources without checks

b)

Denying resource requests that may lead to deadlock

c)

Always allowing processes to run indefinitely

d)

Randomly aborting processes

34.

What does a resource allocation graph illustrate?

a)

The speed of processes

b)

The relationship between processes and resources

c)

The memory usage of processes

d)

The operating system's performance metrics

35.

Which mechanism can be used to block a thread until a condition is met?

a)

Semaphore

b)

Mutex

c)

Condition Variable

d)

Spinlock

36.

What is starvation in the context of process scheduling?

a)

A process receiving resources too quickly

b)

A runnable process that is overlooked indefinitely

c)

A condition of high resource availability

d)

A successful execution of a process

37.

Which method is commonly used for deadlock detection?

a)

Periodic resource checks

b)

Immediate resource denial

c)

Ignoring resource requests

d)

Allowing processes to run indefinitely

38.

What is the least common method for recovering from deadlocks?

a)

Aborting all deadlocked processes

b)

Backing up each deadlocked process

c)

Allowing processes to continue executing

d)

Preempting resources from deadlocked processes

39.

What is the purpose of a monitor in concurrent programming?

a)

To encapsulate variables and access procedures

b)

To track process execution time

c)

To provide unlimited access to shared resources

d)

To manage CPU scheduling

40.

What is an atomic operation?

a)

An operation that can be interrupted by other processes

b)

An indivisible operation that appears to execute as a single step

c)

A lengthy operation that can take multiple cycles

d)

An operation that is always executed in parallel