SLIDE 23 Thread Synchronization Overhead: Challenge Master/Worker Architecture
Master coordinates simulation progress p g Workers do actual processing Synchronization involves
future event set
Increases Threading Overhead Incr Increases T eases Threading Ov eading Overhead erhead
y
Workers wait for incoming jobs Access to shared data structures
event scheduler
Increases Threading Overhead
- sys-calls into kernel
- context switches
Incr Increases T eases Threading Ov eading Overhead erhead
- Sys-calls into kernel
- Context switches
Straightforward Implementation
Locks condition variables
work queue
Locks, condition variables Workers pull jobs from work queue If lock occupied or no job available
worker worker worker
If lock occupied or no job available
Suspend thread Free-up CPU resources
23
Georg Kunz, Mirko Stoffers, James Gross, Klaus Wehrle
Communication and Distributed Systems
Free up CPU resources