Applications of Threads

Applications of Threads - Applications of Threads...

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

View Full Document Right Arrow Icon
Applications of Threads Concurrent Server applications Assume a web server that receives two requests: First, one request from a computer connected through a modem that will take 2 minutes. Then another request from a computer connected to a fast network that will take .01 secs. If the web server is single threaded, the second request will be processed only after 2 minutes. In a multi-threaded server, two threads will be created to process both requests simultaneously. The second request will be processed as soon as it arrives.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Application of Threads Taking Advantage of Multiple CPUs A program with only one thread can use only one CPU. If the computer has multiple cores, only one of them will be used. If a program divides the work among multiple threads, the OS will schedule a different thread in each CPU. This will make the program run faster.
Background image of page 2
Applications of Threads Interactive Applications.
Background image of page 3

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

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

Page1 / 5

Applications of Threads - Applications of Threads...

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

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