libuv/docs/src/static
Trevor Norris 6600954906
win,unix: change execution order of timers (#3927)
The maximum number of times timers should run when uv_run() is called
with UV_RUN_ONCE and UV_RUN_NOWAIT is 1. Do that by conditionally
calling timers before entering the while loop when called with
UV_RUN_DEFAULT.

The reason to always run timers at the end of the while loop, instead of
at the beginning, is to help enforce the conceptual event loop model.
Which starts when entering the event provider (e.g. calling poll).

Other than only allowing timers to be processed once per uv_run()
execution, the only other noticeable change this will show is if all the
following are true:
* uv_run() is called with UV_RUN_NOWAIT or UV_RUN_ONCE.
* An event is waiting to be received when poll is called.
* Execution time between the call to uv_timer_start() and entering the
  while loop is longer than the timeout.

If all these are true, then timers that would have executed before
entering the event provider will now be executed afterward.

Fixes: https://github.com/libuv/libuv/issues/3686
Co-authored-by: Momtchil Momtchev <momtchil@momtchev.com>
2023-03-20 10:04:57 -06:00
..
diagrams.key doc: strip ICC profile from 2 jpg files 2020-02-07 22:08:04 +01:00
architecture.png doc: add API documentation 2014-09-11 09:38:35 +02:00
favicon.ico doc: add API documentation 2014-09-11 09:38:35 +02:00
logo.png doc: add API documentation 2014-09-11 09:38:35 +02:00
loop_iteration.png win,unix: change execution order of timers (#3927) 2023-03-20 10:04:57 -06:00