wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CPE333 Operating System

Total questions: 36

Worksheet time: 18hrs 0mins

Name
Class
Date
1.

What is not true about concurrency?

a)

Operating system can run many processes at the same time on multi-core processor

b)

Operating system can run many threads at the same time on multi-core processor

c)

Memory of a process cannot be shared with other processes

d)

When a process has several threads, race condition might occur

e)

Only one process can be executed on a core of a processor at one time

2.

What is not true about thread?

a)

Each thread has separate address spaces

b)

Each thread has its own PC

c)

All threads share resource with in a process

d)

OS also needs to context-switch threads

e)

Thread shares data but has separate stack

3.

What is not true about race condition?

a)

To prevent race condition, mutex must be guaranteed when critical region is entered

b)

Mutex allows one of several threads to enter a critical region

c)

Race condition makes process runs faster

d)

Race condition might occur when threads share resources

e)

Race condition will not occur if one thread is running at a time

4.

Which of the following statements cannot be a critical region?

a)

A region that allows multiple processes to access shared resources simultaneously without synchronization.

b)

A region where only one process can execute at a time to access shared resources.

c)

A region protected by mutual exclusion mechanisms.

d)

A region that prevents race conditions by controlling process access.

5.

Which system call can cause the main thread to wait for child thread to terminate?

a)

pthread_cond_wait

b)

pthread_join

c)

pthread_create

d)

pthread_cond_init

e)

pthread_mutex_init

6.

What is not true about lock?

a)

compare_and_swap is a hardware lock

b)

Spin lock wastes CPU cycles waiting

c)

Software test and set is not correct

d)

We can create pure software lock

e)

We can you interrupt to create lock

7.

What is true about lock?

a)

Fetch and add does not know the order of lock request

b)

Compare-and-swap is fairer than test-and-set

8.

What is the software not a support to solve wasting cycles with lock?

a)

Sleep instead of spin

b)

Yield system call

c)

Park when lock

d)

Using waiting queue for lock request

e)

All are software supports to solve wasting cycles

9.

What is not true about bounded buffer problem?

a)

The program does not work with one conditional variable

b)

Producer is waiting on empty condition

c)

Consumer is waiting on full condition

d)

Mutex is used to count available items

e)

You need all mutex, full, and empty

10.

What does a producer call when it produces something?

a)

mutex_lock(&mutex)

b)

mutex_unlock(&mutex)

c)

cond_signal(&fill)

d)

cond_signal(&empty)

11.

What does a consumer call when it consume something?

a)

mutex_lock(&mutex)

b)

mutex_unlock(&mutex)

c)

cond_signal(&fill)

d)

cond_signal(&empty)

e)

cond_wait(&fill,&mutex)

12.

What is true about semaphore?

a)

There are binary and continuous semaphore

b)

When sem_post is called, value is decreased by 1

c)

When sem_wait is call, value is increased by 1

d)

Semaphore value can only be 0 and 1

e)

Semaphore can be used to create mutex

13.

Which statement is not true?

a)

Each resource types only have one instance

b)

A process has to request for a resource before use

c)

A process needs to hold a resource while using it

d)

When a process finish the task, resources can be released

e)

A process cannot hold processor

14.

Which problem does cause by resource allocation?

a)

Race condition

b)

Deadlock

c)

Trashing

d)

Internal fragmentation

e)

Zombie

15.

What is true about deadlock?

a)

A deadlock needs more than one process to occur

b)

Deadlock will occur when many processes are waiting for CPU

c)

Deadlock will occur when virtual memory is running low

d)

Deadlock will occur if process need to hold resources and wait for other resources

e)

Deadlock will occur even there is only one resource type

16.

What is not the four conditions of deadlock?

a)

Mutual exclusion

b)

Non-preemption

c)

Virtualization

d)

Hold and wait

e)

Circular wait

17.

When does a deadlock might occur?

4 lines
18.

A deadlock will never occur with which deadlock management?

a)

Prevention

b)

Avoidance

c)

Detection

d)

Both prevention and avoidance

e)

Deadlock will occur in all management

19.

Which deadlock management needs recovery?

a)

Prevention

b)

Avoidance

c)

Detection

d)

Both prevention and avoidance

e)

All managements need recovery scheme

20.

Which problem does requesting resource in increasing order would solve?

a)

No preemption

b)

Hold and wait

21.

Which of the following is a necessary condition for deadlock?

a)

Mutual exclusion

b)

Circular wait

c)

Starvation

22.

Which method can solve no preemption?

a)

test_and_set

b)

yield

c)

try_lock and try_wait

d)

fetch_and_add

e)

request resource in increasing order

23.

What is not true about Banker's algorithm?

a)

Process must declare maximum number of resources

b)

Deadlock might occur in safe state

c)

Need is Max minus allocation

d)

Deadlock will occur in unsafe state

e)

Request can be granted if resource left is more than needed resource

24.

What could deadlock recovery do?

a)

Deny request

b)

Terminate processes

c)

Preempt resource from process

d)

Put process on wait queue

25.

Which statement is not true?

a)

Wait-for graph is equivalent to resource allocation graph

b)

Resource allocation graph is used in deadlock avoidance

c)

Resource allocation graph is used in deadlock detection

d)

There is no resource in wait-for graph

e)

Deadlock occurs when there is a loop in wait-for graph

26.

Which method is when the device-registers are mapped into the memory space of the system?

a)

System call

b)

Interrupt

c)

Direct memory access

d)

Memory-Mapped I/O

e)

Pooling

27.

Which statement is not true?

a)

Pooling is the most efficient method to access IO

b)

Interrupt can be hardware and software

c)

Interrupt frees up processor to do something else

d)

DMA moves data from device directly into memory

e)

Interrupt vector table stores locations of service routines

28.

Which layer knows how to read and write specific block of device?

a)

Application layer

b)

File system

c)

Generic block layer

d)

Device driver

e)

All layers can directly read and write blocks on device

29.

Which Disk Scheduling Algorithms might cause starvation?

a)

FCFS

b)

SSTF

c)

SCAN

d)

LOOK

e)

No starvation in disk scheduling

30.

Which Disk Scheduling Algorithms does sweeps from the outer to inner track and then back to the outer, again?

a)

FCFS

b)

SSTF

c)

SPTF

d)

SCAN

e)

LOOK

31.

What is not true about RAID

4 lines
32.

RAID 1 is _________

a)

mirror with no stripping

b)

striping with no mirroring

c)

parity with striping

d)

single disk storage

33.

RAID 2 is _________

a)

has error correcting code

b)

uses mirroring only

c)

is not fault tolerant

d)

uses only striping

34.

RAID 3 is _________

a)

Bit-striping and dedicated parity disk

b)

Block-striping and distributed parity

c)

Mirroring with no parity

d)

Block-striping with no parity

35.

RAID 4 is _________

a)

Block-striping and block-mirroring

b)

Bit-level striping with parity

c)

Block-level striping with dedicated parity

d)

Mirroring with distributed parity

36.

Which file allocation method is FAT?

a)

Linked allocation

b)

Contiguous allocation

c)

Indexed allocation

d)

Multi-level indexed allocation

e)

Combined scheme