1/31
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
How many processor does a sequential program use?
1
how do multiple processes work
difference processes can run on serparate processors and/or perform separate tasks
what is the most efficient IPC mechanism to share resources. and why
Shared Memory. no system call after inital set up, no copying between buffers
What are the cons of shared memory
needs explicit set up to enable to share memory
Creating and destroying process is expensive since it needs to allocate resoruces for new process to execute it
Switching (context) between process is expensive since it requires saving one process and loading another.
Is a program counter a thread resource
Yes
Is an instruction register a thread resource
Yes
Is condition code register a thread resouce
Yes
Is a stack pointer a thread resource
Yes
Is stack a thread resource
Yes
Is CPU register a thread resource
Yes
Is address space process specific resource
Yes
Is code process specific resource
Yes
Is data process specific resource
Yes
Is heap process specific resource
Yes
Is memory process specific resource
Yes
Is cache process specific resource
Yes
Where are threads created destroyed and managed including context switching
Kernel space
Where does kernal maintain thread specific information
Thread control block (TCB)
Advantages of user level threads
Low Overhead
cheaper to create destroy and mangae
no mode switch required
Flexible scheduling
thread can be tailored to the needs of app. to maximize performance
Disadvantages of user level threads
No parallelism
one thread can be run at a time
only one CPU is used even if multiple CPUs
Dependent Progress
one thread process invokes blocking operation then entire process is blocked
one for all and all for one
Advantages of kernel level threads
Optimal CPU Utilization
each thread of a process can be possibly run on a separate processor
Independent Progress
if one thread of a process invokes a blocking operation, then only that thread of the process is blocked
To Each its Own!
Disadvantages of kernel level threads
High Overhead
expensive to create destroy and manage
2 mode switches required for each operation
Which one defines Many-to-one
User-level threading in which process only has user level threads
Which one defines One-to-one
Kernal-level threading in which process only has kernal level threads
Which one defines Many-to-many
Hybrid threading in which process has both user-level and kernel-level threads
Which thread abstraction model is hard to implement
Many-to-many
What does asynchronous cancellation do?
Thread is canceled immediately
What does deferred cancellation do?
Thread is notified to cancel itself by setting a flag which is read by the thread periodically
desirable if the thread is the middle of modifying shared data and canceling it immediately may corrupt the data
If a thread has its own separate copy for certain variables what is it stored as
static data
How does a thread having its own copy for certain varaibles help improve performance
performing compiler level optimization
how to create a thread pool
collection of worker threads once and select a free thread to performa a specific task when needed
how does thread pools improve performance of application
new tasks arrive/are generated at run time which eliminates overhead of creating and destroying threads at run time