Threads, SMP, and Microkernels

Download Threads, SMP, and Microkernels

Preview text

Threads, SMP, and Microkernels
Chapter 4

?Processes and threads ?Symmetric multiprocessing ?Microkernels ?Window 2000 thread and SMP
management ?Solaris thread and SMP management ?Linux process and thread management

Processes of yesterday
?Unit of resource ownership
?process is allocated a virtual address space to hold the process image
?Unit of dispatching
?scheduled and dispatched by the OS ?execution may be interleaved with other processes
?These two characteristics are treated independently by today’s operating system

Processes of today
?Process or task
?unit of resource ownership ?virtual address space, main memory, I/O
devices, and files
?Thread or light weight process
?unit of dispatching ?scheduled and dispatched by the OS

?Refers to the ability of an OS to support multiple threads of execution within a single process
?MS-DOS supports a single user process and a single thread
?UNIX supports multiple user processes but only supports one thread per process
?Windows 2000, Solaris, Linux, Mach, and OS/2 support multiple threads

Processes in Multithreaded environment
?A process is the unit of resource allocation and a unit of protection
?have a virtual address space that holds the process image
?protected access to processors, other processes, files, and I/O resources
?Per Process Items
?address space, global variable, open files, child processes, timers, signals, semaphores, account

?Within a process, there may be one or more threads, each with the followings
?thread execution state(running, ready,...) ?saved thread context
?program counter, stack, register set, child threads, memory for local variables
?access to the memory and resources of its process
?all threads of a process share this

Benefits of Threads
?Takes less time to create a new thread than a process
?no need to allocate a virtual address space
?Less time to terminate a thread than a process ?Less time to switch between two threads within
the same process ?Since threads within the same process share
memory and files, they can communicate with each other without invoking the kernel

Preparing to load PDF file. please wait...

0 of 0
Threads, SMP, and Microkernels