{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

4.Threads - Threads Mehdi Kargahi School of ECE University...

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

View Full Document Right Arrow Icon
Threads Mehdi Kargahi School of ECE University of Tehran Spring 2008
Background image of page 1

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

View Full Document Right Arrow Icon
M. Kargahi (School of ECE) Definition square6 What’s the difference between a thread and a process? square6 Heavyweight process: A single thread process square6 What a thread has for itself? square6 Thread-Specific Data square6 Thread ID square6 Program Counter square6 A register set square6 A stack
Background image of page 2
M. Kargahi (School of ECE) Single-threaded and Multithreaded Processes
Background image of page 3

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

View Full Document Right Arrow Icon
M. Kargahi (School of ECE) Examples square6 A Web server square6 A RPC server square6 Since the requests from these servers are similar, it is better to avoid creating new processes that may be much more costly
Background image of page 4
M. Kargahi (School of ECE) The Benefits of Multithreaded Programming square6 Responsiveness square6 If a thread is blocked, other threads can continue square6 E.g., showing an image while getting text from the user in a web page square6 Resource sharing square6 Threads share the memory and resources of the respective process (shared code and data) square6 Economy square6 Allocating memory and resource to processes and their respective context-switch is more costly with respect to threads square6 Solaris: speed of process creation=1/30 speed of thread creation square6 Solaris: speed of process CS=1/5 speed of thread CS square6 Utilization of multiprocessor architectures square6 No speed-up with a heavyweight process on a multiprocessor system square6 Concurrency with multithreaded processes on multiprocessor systems
Background image of page 5

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

View Full Document Right Arrow Icon
M. Kargahi (School of ECE)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}