Part 1
1. What are the possible state transitions of a process?
A process has three states:
1- Running (actually using the CPU at that instant)
2- Ready (runnable; temporarily stopped to let another process run)
3- Blocked (unable to run until some external event happens)
Four transitions are possible among three states
1- Process blocks for input
2- Scheduler picks another process
3- Scheduler picks this process
4- Input becomes available
2. What are the differences between a thread and a process?
Threads exist within a process, every process must have one. Threads share
resources and memory space while processes run in separate memory spaces.
3. User-level threads vs. Kernel-level threads? Describe the pros and cons of each type.
• User level Threads
- Advantages:
+ User level threads are simpler and faster to generate. They are also easier to
manage.
+ Thread switching in user-level threads doesn’t need kernel mode privileges.
+ These are more portable
+ These threads may be run on any OS
- Disadvantages:
+ The complete process is blocked if a user-level thread runs a blocking
operation
+ User-level threads don’t support system-wide scheduling priorities
+ It is not appropriate for a multiprocessor system
• Kernel Level Threads
- Advantages:
+ If a thread in the kernel is blocked, it does not block all other threads in the
same process
+ Several threads of the same process might be scheduled on different CPUs in
kernel-level threading
+ Kernel routines can be multithreaded as well
- Disadvantages:
+ Compared to user-level threads, kernel-level threads take longer to create and
maintain
+ A mode switch to kernel mode is important to transfer control from one thread
in a process to another
4.