L3-Thread_Concept

L3-Thread_Concept - Thread Concepts CSIS0230A Lecture Three...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Thread Concepts CSIS0230A Lecture Three Process verse thread Why multi-threading? Implementation techniques and issues Recommended Reading Chapter 4 of Operating Systems, 3 rd edition by Deitel et. al except section 4.11 CSIS0230A Principles of Operating Systems 2 References Chapter 4 of Operating Systems, 3 rd edition by Deitel et. al Chapter 4 of Operating System Principles, 7 th edition by Silberschatz et. al Chapter 4 of Operating Systems: Internal and Design Principles, 6 th edition by W. Stallings CSIS0230A Principles of Operating Systems 3 Thread verse Process A traditional process has one single thread of execution View the traditional process as a process with one thread Multithreaded process A process has multiple threads of execution Thread of execution A sequence of instructions Relatively independent execution flow Multiple threads of execution Multiple sequences of instructions executing concurrently To support multiple threads multiple program counters, multiple stacks CSIS0230A Principles of Operating Systems 4 Thread Lightweight process (LWP) Shares address space and other global info with its process Registers, stack, signal masks and other thread-specific data are local to each thread CSIS0230A Principles of Operating Systems 5 Why Multithreading? Make inherently parallel tasks simpler to express in code e.g., upon detecting a new incoming request, a web server creates a new thread to handle the new request For performance Less set up is needed, it takes less time to create/terminate a new thread than a new process A process with multiple threads could continue running even if one of its threads is blocked ** Utilization of multiprocessor architectures ** Less overhead in switching between threads Enhance efficiency in communication between threads as they share memory and files CSIS0230A Principles of Operating Systems 6 Thread States...
View Full Document

Page1 / 21

L3-Thread_Concept - Thread Concepts CSIS0230A Lecture Three...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online