CMSC 433 Study Guide - Midterm Guide: Thread Pool, Location Transparency, Performance Tuning

89 views3 pages

Document Summary

Creating a thread each time allots one thread per task, all running in parallel. If you have many tasks and few processors, this could be very expensive (lots of context switching). E(cid:454)plai(cid:374) ho(cid:449) (cid:271)ou(cid:374)ded (cid:271)lo(cid:272)ki(cid:374)g (cid:395)ueues (cid:373)a(cid:455) (cid:271)e used i(cid:374) p(cid:396)odu(cid:272)e(cid:396)co(cid:374)su(cid:373)e(cid:396) appli(cid:272)atio(cid:374)s to (cid:862)slo(cid:449) do(cid:449)(cid:374)(cid:863) producers to match the rate at at which consumers process elements from the queue. This thread can therefore not produce more elements while it is suspended. If the rate of production exceeds the rate of consumption, the net effect is therefore that more and more producers are suspended until the rates of production is approximately at the rate of consumption. Explain the difference between a countdownlatch object and a semaphore object. In the case of a countdownlatch, a thread executing an await() on such an object are blocked until the value of the latch reaches 0, at which point all such threads are released an allowed to start executing.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers

Related Documents