CMSC 433 Study Guide - Midterm Guide: Thread Safety, Programming Paradigm, Concurrency Control

188 views49 pages

Document Summary

Singlethreadwebserver: an instance of sequential task processing. Bt rappaport: each task (connection) is handled by main thread, handlerequest() implemented elsewhere. Threadpertaskwebserver: each task given a separate thread, under light-to-moderate load, this improves throughput and responsiveness, heavy load: too many threads! Executors: a middle ground between sequential task processing and thread-per-task processing. Interface: public interface executor { void execute(runnable command); } Bt rappaport: overload policy? (which task to kill, and how, pre-/ post-task actions to perform, if any, execution policies are a resource-management tool: permit management of concurrency visa vis number of processors, other resources. Threadpools: contains collection of homogeneous worker threads, worker threads: request next task from work queue, execute it, return to waiting for next task, advantages (vs. creating new thread) What about tasks submitted after shutdown: they are handled by the rejected execution handler, could swallow tasks/ could throw rejectedexecutionexception/ depends on implementation!

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents