While PR#6103 (https://github.com/apache/trafficserver/pull/6103) solves
the problem of having the 60ms delay (caused by waiting in sleep), it also
creates an issue where the event loop ends up in a "dead loop" if the
scheduled event schedules itself with 0 timeout (see test code by scw00).
Here's what I have in mind that will fix the problem.


   1. New API "TSContDispatch", which will be basically the current
   "TSContSchedule" calls with 0 timeouts.
   2. When scheduling events/continuations using "TSContSchedule" API with
   0 timeouts, set flag to identify the event to be processed on the next
   event loop.
   3. New "LocalQueue" class to handle events that are supposed to be
   processed in the next event loop.

Here's the branch I'm working on right now, it shows an easy concept of the
"LocalQueue".
https://github.com/duke8253/trafficserver/tree/master-event_dispatch

Reply via email to