Chapter 6 : Process and Threads Flashcards
What is a process?
- A process is a program in execution, consisting of the program code, data and system resources
List out 3 key characteristics of processes
- Own memory space
- Isolated from other processes
- Managed by the OS
List out 5 state of processes
- New
- Process is being created
- Ready
- Process is waiting to be assigned to a processor
- Running
- Process instructions are being executed
- Waiting
- Process is waiting for some event to occur
- Terminated
- Process has finished execution
What is the full name for IPC?
- Inter-Process Communication
How does IPC allows processes to communicate and synchronize their actions effectively?
- IPC mechanisms includes shared memory and message passing
What is a threads inside a processes?
- A thread is the smallest unit of execution within a process
What does threads share?
- It shares the process’s resources
- But it operates independently
List out 3 characteristics of Threads
- Shares memory space with other threads in the same process
- Has its own stack and registers
- Faster to create and manage compared to processes
What is the difference between memory space in Threads and Processes?
- Processes
- Separate memory space
- Threads
- Shared memory within the same process
What is the difference between communication in Threads and Processes?
- Processes
- IPC Needed
- Threads
- Direct communication via shared memory
What is the difference between creation in Threads and Processes?
- Processes
- Slower to Create
- Threads
- Faster to Create
What is the difference between overhead in Threads and Processes?
- Processes
- Higher overhead due to isolation
- Threads
- Lower overhead
What is Multithreading?
- Is the ability of a CPU or a single core within a CPU to execute multiple threads concurrently
What is the advantages of Multithreading?
- Improves Application Performance
- Efficient use of CPU resources
- Facilitates responsive applications
List out 2 example applications tha is using Multithreading
- Web Servers
- Modern Operating Systems
Why do we need synchronization techniques for process and thread?
- To avoid race conditions and ensure data consistency when multiple threads/processes access shared recourses
List out 4 common synchronization techniques forprocess and thread synchronization
- Mutexes
- Semaphores
- Monitors
- Locks
List out 2 benefits of using threads
- Improved performance and resource allocation
- Simplifies program structure for concurrent tasks
List out 2 challenges for threads
- Complexity in synchronization and avoid deadlocks
- Difficulty in debugging multithreaded applications
List out 2 types of Threads in the Operating System
- User Threads
- Managed by user applications
- Kernel Threads
- Managed by Kernel
List out 3 user threads
- POSIX Pthreads
- Windows Threads
- Java Threads
List out 5 Kernel Threads
Virtually all General Purpose Operating System
1. Windows
2. Solaris
3. Linux
4. Tru64 UNIX
5. Mac OS X
List out three Multithreading Models
- Many to One
- One to One
- Many to Many
What does Many to One mean in Multhithreading Model?
- Many user-level threads mapped to single kernel thread
- Few Systems currently use this model