Unit -2 Flashcards

(62 cards)

1
Q

What is a thread in the context of operating systems?

A

A thread is the smallest unit of processing that can be scheduled by an operating system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

True or False: A process can contain multiple threads.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is multithreading?

A

Multithreading is the ability of a CPU or a single core to provide multiple threads of execution concurrently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Fill in the blank: The _______ is responsible for managing threads in an operating system.

A

scheduler

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two types of thread management?

A

User-level threads and kernel-level threads.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the primary advantage of multithreading?

A

It allows for more efficient CPU usage and improved application performance.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Multiple Choice: Which of the following is NOT a scheduling type? A) Preemptive B) Cooperative C) Iterative D) Time-slicing

A

C) Iterative

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does preemptive scheduling allow the operating system to do?

A

It allows the operating system to interrupt a currently running thread to start or resume another thread.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True or False: Cooperative scheduling relies on threads to voluntarily yield control.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a critical section in multithreading?

A

A critical section is a part of the code that accesses shared resources and must not be executed by more than one thread at a time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a context switch?

A

A context switch is the process of storing the state of a thread so it can be resumed later.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fill in the blank: The _______ algorithm allocates CPU time to threads based on their priority.

A

priority scheduling

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of thread synchronization?

A

To ensure that multiple threads can operate safely on shared data without conflict.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Multiple Choice: Which of the following is a common synchronization mechanism? A) Mutex B) Semaphore C) Lock D) All of the above

A

D) All of the above

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is starvation in the context of thread scheduling?

A

Starvation occurs when a thread is perpetually denied the resources it needs to proceed with execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

True or False: Round-robin scheduling is a type of preemptive scheduling.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the main objective of a scheduling algorithm?

A

To allocate CPU time effectively among multiple threads or processes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Fill in the blank: In a _______ environment, multiple processors are used to execute multiple threads simultaneously.

A

multiprocessor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is load balancing in multiprocessor systems?

A

Load balancing is the process of distributing workloads across multiple processors to optimize resource use and minimize response time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Multiple Choice: Which scheduling algorithm is designed for real-time systems? A) FIFO B) Round Robin C) Rate Monotonic D) Shortest Job First

A

C) Rate Monotonic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What is the definition of throughput in scheduling?

A

Throughput is the number of processes completed in a given amount of time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is latency in the context of thread scheduling?

A

Latency is the time taken from the submission of a process until its first execution.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

True or False: A thread can exist without a process.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is a thread pool?

A

A thread pool is a collection of pre-initialized threads that can be reused for executing tasks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Fill in the blank: _______ allows threads to run concurrently, but not necessarily in parallel.
Multithreading
26
What does the term 'context' refer to in the context of threads?
Context refers to the current state of a thread, including its registers, stack, and program counter.
27
Multiple Choice: Which of the following is a disadvantage of multithreading? A) Increased resource sharing B) Complexity in debugging C) Improved performance D) Better resource utilization
B) Complexity in debugging
28
What is the difference between user-level threads and kernel-level threads?
User-level threads are managed by the user-level library, while kernel-level threads are managed by the operating system.
29
True or False: Kernel-level threads can be scheduled independently by the operating system.
True
30
What is a semaphore?
A semaphore is a synchronization primitive that uses a counter to control access to shared resources.
31
Fill in the blank: _______ scheduling can lead to better average turnaround time compared to other types.
Shortest Job First
32
What is a deadlock in multithreading?
A deadlock is a situation where two or more threads are unable to proceed because they are each waiting for the other to release resources.
33
What is a race condition?
A race condition occurs when two or more threads attempt to change shared data at the same time, leading to inconsistent results.
34
True or False: A multiprocessor system can improve performance by executing multiple threads in parallel.
True
35
What does 'scalability' refer to in a multiprocessor environment?
Scalability refers to the ability to increase performance by adding more processors.
36
Fill in the blank: _______ is a scheduling criterion that aims to minimize the waiting time for processes.
Shortest Job First
37
What is the main disadvantage of preemptive scheduling?
It can lead to increased overhead due to context switching.
38
Multiple Choice: Which scheduling algorithm is most likely to cause starvation? A) Round Robin B) Priority Scheduling C) Shortest Job First D) First-Come, First-Served
B) Priority Scheduling
39
What is the purpose of a mutex?
A mutex is used to ensure that only one thread can access a resource at a time.
40
True or False: All threads within a process share the same address space.
True
41
What is time-slicing in scheduling?
Time-slicing is a technique where each thread is given a small time slot to execute before the next thread is scheduled.
42
Fill in the blank: The _______ algorithm is designed to ensure that all processes receive fair share of CPU time.
Round Robin
43
What is a thread-safe function?
A thread-safe function is one that can be safely called from multiple threads at the same time without causing data corruption.
44
Multiple Choice: Which of the following is NOT a scheduling criterion? A) Turnaround Time B) Response Time C) Memory Usage D) Throughput
C) Memory Usage
45
What is the role of the dispatcher in thread scheduling?
The dispatcher is responsible for switching the CPU from one thread to another.
46
True or False: Threads can communicate with each other through shared memory.
True
47
What is the difference between soft real-time and hard real-time systems?
Hard real-time systems must meet deadlines, while soft real-time systems aim to meet deadlines but can tolerate some delays.
48
Fill in the blank: A _______ is a high-level abstraction that represents a thread of execution.
task
49
What is the main goal of scheduling algorithms?
To optimize CPU utilization and ensure fair allocation of resources among processes.
50
Multiple Choice: What does the term 'multi-core' refer to? A) Multiple CPUs B) Multiple threads C) Multiple cores in a single CPU D) None of the above
C) Multiple cores in a single CPU
51
What is the effect of thread contention?
Thread contention occurs when multiple threads compete for the same resources, which can lead to decreased performance.
52
True or False: All operating systems support multithreading.
False
53
What does the term 'load sharing' mean in a multiprocessor environment?
Load sharing refers to the distribution of workloads across multiple processors to improve performance.
54
Fill in the blank: The _______ algorithm selects processes based on their predicted execution time.
Shortest Job First
55
What is the role of a thread library?
A thread library provides the necessary functions and interfaces for creating and managing threads.
56
Multiple Choice: Which type of thread is managed entirely by the user-level library? A) Kernel thread B) User thread C) Hybrid thread D) None of the above
B) User thread
57
What does 'fairness' refer to in scheduling?
Fairness refers to the equitable allocation of CPU time among all processes.
58
True or False: A thread can be suspended and resumed at will.
True
59
What is the purpose of a condition variable?
A condition variable allows threads to wait for certain conditions to be true before proceeding.
60
Fill in the blank: In a _______ scheduling policy, each process is assigned a fixed time slice for execution.
time-sharing
61
What is the significance of priority in scheduling?
Priority determines the order in which threads are scheduled for execution.
62
Multiple Choice: Which of the following is a disadvantage of cooperative scheduling? A) Increased responsiveness B) Possibility of starvation C) Simplicity D) All of the above
B) Possibility of starvation