On Fri, May 13, 2016 at 4:33 AM, Luca Toscano <toscano.l...@gmail.com> wrote: > - What does PT_USER represents and how it is used?
PT_USER is what event tracks when you call event_register_poll_callback(). This callback allows a module to run some code when either of a pair of sockets becomes readable or writable. It was written to allow mod_proxy_wstunnel to not tie up a thread when both ends of the connection are idle. Note that it is still trunk-only. > - How is a new timer inserted in the skiplist? I followed the code and the > only "insert" actions that I can see are triggered by event_get_timer_event, > that is used for PT_USER events and by the function hooked to > mpm_register_timed_callback (I can see it declared in mpm_common but no idea > about how/when it runs). There are also some peek/pop actions executed > before apr_pollset_poll but no trace of inserts. It is via the insert in event_get_timer_event() PT_USER uses the timer part to implement a timeout callback on waiting for the sockets to become usable. it was added as a proof of concept, IIUC, for mod_dialup to help demonstrate async handlers (give the thread back by returning SUSPENDED and run again later by being called back after some time) > > I know that those are very generic questions so even some hints would be > really appreciated. I have some goals in mind: > > 1) Add an overview in https://httpd.apache.org/docs/current/mod/event.html > (maybe adding a definitive answer to > https://bz.apache.org/bugzilla/show_bug.cgi?id=57399) > 2) Create infographics (or even simple images) about prefork/worker/event > (and motorz?) to compare them in a "under the hood" section of the > documentation. It might be good to separate design details from the reference manual so users are not overwhelmed > 3) Complete http://httpd.apache.org/docs/current/misc/perf-tuning.html. There is a PR or other kind of complaint about the hard-coded 100ms sleep time even when no timers may be in use. Since timers are not used by common modules, it should be possible to improve this. -- Eric Covener cove...@gmail.com