Commit 8199f3c
committed
Consolidate epoll, kqueue, and select into shared reactor layer
Introduce a shared reactor/ directory with CRTP templates that capture
the common structure of all three POSIX backends: operation state,
descriptor state, socket/acceptor impls, service ownership, and the
full scheduler threading model.
New shared headers:
- reactor_op.hpp: base op with cancellation, stop_token, perform_io
- reactor_descriptor_state.hpp: per-fd state with deferred I/O
- reactor_socket.hpp: connect, read_some, write_some, cancel, close
- reactor_acceptor.hpp: bind, listen, accept, cancel, close
- reactor_service_state.hpp: service ownership (mutex, list, map)
- reactor_scheduler.hpp: signal state machine, inline completion
budget, work counting, run/poll event loop, cleanup guards
Backend files become thin wrappers providing only platform-specific
hooks: write policy (sendmsg flags), accept policy (accept4 vs
accept+fcntl), and the reactor poll function (epoll_wait, kevent,
select). All shared logic — speculative I/O, deferred I/O dispatch,
cancellation, close, thread coordination — lives in the templates.
Correctness fixes applied during normalization:
- EINTR retry on kqueue read path
- Release ordering on add_ready_events/is_enqueued_ (ARM correctness)
- Exception-safe task_cleanup with private queue drain
- stopped_ as plain bool (always under mutex)1 parent ce1c43e commit 8199f3c
File tree
26 files changed
+3512
-6332
lines changed- include/boost/corosio/native/detail
- epoll
- kqueue
- reactor
- select
26 files changed
+3512
-6332
lines changedLines changed: 8 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
21 | 18 | | |
22 | | - | |
23 | | - | |
| 19 | + | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
28 | 24 | | |
29 | 25 | | |
30 | 26 | | |
31 | | - | |
32 | | - | |
33 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
34 | 33 | | |
35 | 34 | | |
36 | 35 | | |
| |||
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | 46 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 47 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | 48 | | |
89 | 49 | | |
90 | 50 | | |
| |||
0 commit comments