TheadPools - CS 580 Client-Server Programming Spring...

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

View Full Document Right Arrow Icon
CS 580 Client-Server Programming Spring Semester, 2010 Doc 12 Thread Pools 8 March, 2010 Copyright ©, All rights reserved. 2010 SDSU & Roger Whitney, 5500 Campanile Drive, San Diego, CA 92182-7700 USA. OpenContent ( http:// www.opencontent.org/opl.shtml ) license defines the copyright on this document.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Thread Pool Pattern 2 Thread Pooling Group of threads created to perform a number of tasks A thread Reads a task from a queue Performs the task Repeat See http://en.wikipedia.org/wiki/Thread_pool_pattern
Background image of page 2
Server Options 3 Iterative Server - server handles one client at a time Concurrent Server with Thread creation Create new thread for each client Concurrent Server with Thread Pool Concurrent Server with expandable Thread Pool Single thread handles multiple clients concurrently
Background image of page 3

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

View Full DocumentRight Arrow Icon
Iterative Server - When to use 4 Iterative Server while (true) { Socket client = serverSocket.accept(); Sequential code to handle request } When usable TP = Time to process a request A = arrival time between two consecutive requests Then we need TP << A
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

TheadPools - CS 580 Client-Server Programming Spring...

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

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