Chapter 6 : Process and Threads Flashcards

1
Q

What is a process?

A
  1. A process is a program in execution, consisting of the program code, data and system resources
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

List out 3 key characteristics of processes

A
  1. Own memory space
  2. Isolated from other processes
  3. Managed by the OS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

List out 5 state of processes

A
  1. New
    • Process is being created
  2. Ready
    • Process is waiting to be assigned to a processor
  3. Running
    • Process instructions are being executed
  4. Waiting
    • Process is waiting for some event to occur
  5. Terminated
    • Process has finished execution
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the full name for IPC?

A
  1. Inter-Process Communication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does IPC allows processes to communicate and synchronize their actions effectively?

A
  1. IPC mechanisms includes shared memory and message passing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a threads inside a processes?

A
  1. A thread is the smallest unit of execution within a process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does threads share?

A
  1. It shares the process’s resources
  • But it operates independently
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

List out 3 characteristics of Threads

A
  1. Shares memory space with other threads in the same process
  2. Has its own stack and registers
  3. Faster to create and manage compared to processes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the difference between memory space in Threads and Processes?

A
  1. Processes
    • Separate memory space
  2. Threads
    • Shared memory within the same process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the difference between communication in Threads and Processes?

A
  1. Processes
    • IPC Needed
  2. Threads
    • Direct communication via shared memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between creation in Threads and Processes?

A
  1. Processes
    • Slower to Create
  2. Threads
    • Faster to Create
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the difference between overhead in Threads and Processes?

A
  1. Processes
    • Higher overhead due to isolation
  2. Threads
    • Lower overhead
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Multithreading?

A
  1. Is the ability of a CPU or a single core within a CPU to execute multiple threads concurrently
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the advantages of Multithreading?

A
  1. Improves Application Performance
  2. Efficient use of CPU resources
  3. Facilitates responsive applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

List out 2 example applications tha is using Multithreading

A
  1. Web Servers
  2. Modern Operating Systems
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Why do we need synchronization techniques for process and thread?

A
  1. To avoid race conditions and ensure data consistency when multiple threads/processes access shared recourses
17
Q

List out 4 common synchronization techniques forprocess and thread synchronization

A
  1. Mutexes
  2. Semaphores
  3. Monitors
  4. Locks
18
Q

List out 2 benefits of using threads

A
  1. Improved performance and resource allocation
  2. Simplifies program structure for concurrent tasks
19
Q

List out 2 challenges for threads

A
  1. Complexity in synchronization and avoid deadlocks
  2. Difficulty in debugging multithreaded applications
20
Q

List out 2 types of Threads in the Operating System

A
  1. User Threads
    • Managed by user applications
  2. Kernel Threads
    • Managed by Kernel
21
Q

List out 3 user threads

A
  1. POSIX Pthreads
  2. Windows Threads
  3. Java Threads
22
Q

List out 5 Kernel Threads

A

Virtually all General Purpose Operating System
1. Windows
2. Solaris
3. Linux
4. Tru64 UNIX
5. Mac OS X

23
Q

List out three Multithreading Models

A
  1. Many to One
  2. One to One
  3. Many to Many
24
Q

What does Many to One mean in Multhithreading Model?

A
  1. Many user-level threads mapped to single kernel thread
  • Few Systems currently use this model
25
List out 2 examples for Many-To-One Multhreading Model
1. Solaris Green Threads 2. GNU Portable Threads
26
What does One-to-One mean in Multithreading Model?
1. Each user-level thread maps to kernel thread * Creating a user-level thread creates a kernel thread
27
What is the difference between Many to One and One to One in Multhreading Model?
1. One to One provide more concurrency than many to one
28
What are the disadvantages of One to One Mulithreading Model?
1. Number of threads per process sometimes restricted due to overhead
29
List out 3 examples for Multhreading Model
1. Windows 2. Linux 3. Solaris 9 and later
30
What does Many-to-Many mean in Multithreading Model?
1. Allows many user level threads to be mapped to many kernel threads 2. Allows the OS to create a sufficient number of kernel threads * Example 1. Solaris ( UNIX ) Prior to Version 9 2. Windows with the ThreadFiber package
31
What does Thread Library provides to programmer?
1. With API for creating and managing threads
32
List out 2 ways that programmer implement thread library
1. Library entirely in user space 2. Kernel-level Library supported by the OS
33
List out 2 methods of aborting process / threads to eliminate deadlocks
1. Abort all Deadlocked processes 2. Abort one process at a time until the deadlock is resolved * Then reclaim all resources from terminated processes