COP4600 Midterm Review Questions With 100% Correct Answers.
______ is a part of a process that has ______ - Thread; It's own execution history( can't have without a stack) Program Counter Stack Every process has ______ threads and every thread ____ - one or more threads; belongs to exactly one process Elements that are unique to a process but not a thread - text(instructions) data (constants/statics) heap( dynamic allocations) Reason to use multiple threads instead of process - Can reduce overhead and facilitate sharing **Threading: Classical Model; Explain Uniprogrammed, Multiprocess Model, and Threaded Model - Uni: One process at at time, wait for a process to finish; Multiprocess:Process switch in and out. Threaded switch between threads within a process. ( this reduces context switch times) Why do we use threads --break up complicated tasks into simple ones -improve efficiency compared to new processes, threads have - -lower memory cost(shared segments) -information sharing ( through shared data)-reduced creation, destruction time (allocation, copying) -reduce context time ( to another thread in the same process only) What's in a thread? (Give Process Specific versus Thread Specific Components) - Specific to A Thread: Program Counter Registers Stack State Specific to A Process: Address Space Global Variables Open file Child processes Pending alarms signals and handlers CPU accounting Describe the differences between kernel and user space threads - User threads: -User Library -OS-Independent -Syscalls block all process threads -Process threads in 1 CPU -Procedure calls (quick/cheap) Kernel threads: -System Library-OS-Specific -Syscalls block calling thread -Process threads in multiple CPUS -System calls (long/expensive) Thread Scheduling: Kernel versus User - Know that you cannot switch between threads from different processes. So the threads from process B or A then the other in user threads but kernel threads can go back and forth between theses two. Also you can use multiple CPUs for kernel threads so you can A1 in one core. A2 in another core (if they aren't dependent on each other) User threads have to run sequentially. Hybrid Threading - we can mix user and kernel threads to try to get the best of both. (This is complex) (Review Slide 9 of OS-02C)
Written for
- Institution
- COP4600
- Course
- COP4600
Document information
- Uploaded on
- December 21, 2023
- Number of pages
- 8
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
Also available in package deal