|
|
|
|
|
by jfager
5622 days ago
|
|
The main EventManager class synchronizes on triggering a new event. Then every event gets its own brand new thread. Then each newly spawned thread turns around and synchronizes to wait for the right to dispatch to the event's handlers. Then each handler gets its own brand new thread. For m events with n handlers, that's mn+m threads. 100 events w/ 5 handlers? That's 600 new threads. If you have frequent events or your handlers take any time at all, you're dead. This will simply grind to a halt under any kind of real load. |
|