120 likes | 265 Views
University Of Palestine. College of Applied Engineering & Urban Planning Software Engineering Department. Computer Architecture. Computer Architecture. Presents. Multithreading. Multithreading. 2 st Term2009/2010. Multithreading.
E N D
University Of Palestine College of Applied Engineering & Urban PlanningSoftware Engineering Department
Computer Architecture Computer Architecture
Multithreading Multithreading 2st Term2009/2010
Multithreading • Multithreading refers to the ability of an OS to support multiple, concurrent paths of execution within a single process. • The traditional approach of a single thread of execution per process, in which the concept of a thread is not recognized, is referred to as a single-threaded approach.
Multithreading • MS-DOS supports a single thread • UNIX supports multiple user processes but only supports one thread per process • Windows, Solaris, Linux, Mach, and OS/2 support multiple threads
Multithreading • In a multithreaded environment, a process is defined as the unit of resource allocation and a unit of protection.The following are associated with processes: • A virtual address space that holds the process image • Protected access to processors, other processes (for interprocess communication),files, and I/O resources (devices and channels) • Within a process, there may be one or more threads, each with the following: • A thread execution state (Running, Ready, etc.).
Multithreading • The following are associated with processes: • A saved thread context when not running; one way to view a thread is as an independent program counter operating within a process. • An execution stack. • Some per-thread static storage for local variables. • Access to the memory and resources of its process, shared with all other threads in that process. 8
Multithreading • The key benefits of threads derive from the performance implications: • Takes less time to create a new thread than a process • 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 9
Threads and Processes One process One thread One process Multiple threads Multiple processes One thread per process Multiple processes Multiple threads per process
4. References Software Requirements, Second Edition , Karl E.Wiegers. Software Engineering , 8th Edition , lan sommerveill . 11
Thank You ! Done by: Ramy Y. Baraka. Supervisor: Eng : Mohammed Temraz.