wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

BCS303-4

Total questions: 23

Worksheet time: 12mins

Name
Class
Date
1.

A cooperating process is one that —

a)

Never shares data

b)

Affects or is affected by other processes

c)

Runs faster than other processes

d)

Uses multiple CPUs

2.

Concurrent access to shared data may lead to —

a)

Faster execution

b)

Data inconsistency

c)

Deadlock only

d)

No issues

3.

The producer–consumer problem is an example of —

a)

Deadlock

b)

Race condition

c)

Synchronization problem

d)

Memory allocation

4.

A race condition occurs when —

a)

A process runs too slow

b)

Processes access shared data in a critical section incorrectly

c)

CPU switches tasks frequently

d)

Memory becomes full

5.

Critical section refers to —

a)

Code that executes input-output

b)

The portion of code accessing shared data

c)

A non-executable code region

d)

CPU registers

6.

Peterson’s solution works for —

a)

Multiple processes

b)

Exactly two processes

c)

Operating systems only

d)

Memory management

7.

In Peterson’s solution, flag[i] = true means —

a)

Process does not want to enter

b)

Process is ready to enter critical section

c)

Process is terminated

d)

Process is sleeping

8.

The variable turn in Peterson’s solution indicates —

a)

Next process to be created

b)

Whose turn it is to enter critical section

c)

CPU speed

d)

Interrupt request

9.

Hardware instruction used for mutual exclusion —

a)

fork()

b)

testAndSet()

c)

printf()

d)

malloc()

10.

testAndSet() is —

a)

Non-atomic

b)

Atomic

c)

Non-deterministic

d)

Optional

11.

A semaphore is —

a)

A data structure

b)

An integer variable used for synchronization

c)

A hardware device

d)

A CPU scheduling algorithm

12.

Operation that decreases semaphore value —

a)

spawn()

b)

signal()

c)

wait()

d)

stop()

13.

Operation that increases semaphore value —

a)

wait()

b)

signal()

c)

block()

d)

exit()

14.

A binary semaphore can take values —

a)

0 and 1

b)

Any integer

c)

-1 and 1

d)

1 to 10

15.

A counting semaphore can take —

a)

Only 0

b)

Only 1

c)

Only non-negative integers

d)

Only even values

16.

Which problem is associated with managing a buffer shared by multiple processes?

a)

Dining philosophers

b)

Bounded-buffer problem

c)

Reader–writer problem

d)

Memory management

17.

In the bounded-buffer problem, what is the initial value of 'empty'?

a)

0

b)

N

c)

1

d)

-1

18.

In the reader–writer problem, what is true about multiple readers?

a)

Cannot read simultaneously

b)

Can read simultaneously

c)

Can't access shared data

d)

Must wait for writers

19.

In the reader–writer problem, what does the first reader do?

a)

Ignores the writer

b)

Locks the shared resource for all readers

c)

Must wait

d)

Signals writer

20.

What issue does the dining philosophers problem address?

a)

Memory allocation

b)

Deadlock and starvation

c)

Network security

d)

CPU scheduling

21.

In the dining philosophers problem, how is each chopstick represented?

a)

Binary semaphore

b)

Counting semaphore

c)

Mutex only

d)

Thread

22.

Mutual exclusion ensures —

a)

No two processes enter critical section together

b)

All processes enter together

c)

Faster CPU speed

d)

Unlimited waiting

23.

Semaphore wait() operation contains —

a)

S++

b)

S--

c)

S = 0

d)

S = S + 10