1
0
mirror of https://github.com/libuv/libuv synced 2025-03-28 21:13:16 +00:00

Merge ad444b7813d29fd993be443d7f0676507a4a739e into ea1cf034bef1ee39cf453b5b37b98be153541453

This commit is contained in:
Stacey Marshall 2025-03-20 21:02:59 +01:00 committed by GitHub
commit afbfedc1ba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 79 additions and 7 deletions

View File

@ -17,7 +17,9 @@ endif
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRCDIR)
FORM = -t Graphical
man: FORM = -t Textual
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(FORM) $(SPHINXOPTS) $(SRCDIR)
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SRCDIR)

View File

@ -16,10 +16,16 @@ cross-platform file I/O and threading functionality is also provided, amongst ot
Here is a diagram illustrating the different parts that compose libuv and what subsystem they
relate to:
.. image:: static/architecture.png
:scale: 75%
:align: center
.. only:: Graphical
.. image:: static/architecture.png
:scale: 75%
:align: center
:alt: Picture of libuv architecture
.. only:: Textual
.. literalinclude:: static/architecture.txt
Handles and requests
^^^^^^^^^^^^^^^^^^^^
@ -55,10 +61,16 @@ which have been added to the poller and callbacks will be fired indicating socke
In order to better understand how the event loop operates, the following diagram illustrates all
stages of a loop iteration:
.. image:: static/loop_iteration.png
:scale: 75%
:align: center
.. only:: Graphical
.. image:: static/loop_iteration.png
:scale: 75%
:align: center
:alt: Picture of libuv loop iteration
.. only:: Textual
.. literalinclude:: static/loop_iteration.txt
#. The loop concept of 'now' is initially set.

View File

@ -0,0 +1,23 @@
LIBUV
+----------------------------------------------+ +---+ +---+ +---+
| | | | | | | |
| Network I/O | | F | | D | | U |
| | | i | | N | | s |
| | | l | | S | | e |
| | | e | | | | r |
| | | | | O | | |
| | | I | | p | | C |
| +------+ +------+ +------+ +------+ +------+ | | / | | s | | o |
| | TCP | | UDP | | TTY | | Pipe | | ... | | | O | | | | d |
| +------+ +------+ +------+ +------+ +------+ | | | | | | e |
| | | | | | | |
+----------------------------------------------+ +---+ +---+ +---+
+----------------------------------+ +--------+ +---------------+
| uv__io_t | | | | |
+----------------------------------+ | | | |
| IOCP | | Thread Pool |
+-------+ +--------+ +-------------+ | | | |
| epoll | | kqueue | | event ports | | | | |
+-------+ +--------+ +-------------+ +--------+ +---------------+

View File

@ -0,0 +1,35 @@
+------------------------+
| Initialze loop time |
+------------------------+
| Run due timers |
+------------------------+
|
v
__
_____ / \
/ \ / \
/ \ No / Loop \
| end |<-------| alive? |<----------+
\ / \ / |
\ / \ / |
----- \__/ |
| |
| Yes |
v |
+------------------------+ |
| Call pending callbacks | |
+------------------------+ |
| Run idle handles | |
+------------------------+ |
| Run prepare handles | |
+------------------------+ |
| Poll for I/O | |
+------------------------+ |
| Run check handles | |
+------------------------+ |
| Call close callbacks | |
+------------------------+ |
| Update loop time | |
+------------------------+ |
| Run due timers |---+
+------------------------+