Skip to content

Commit 5b2ffba

Browse files
committed
(ditto)
1 parent 964fa92 commit 5b2ffba

File tree

10 files changed

+23
-23
lines changed

10 files changed

+23
-23
lines changed

src/flow/async/concurrent_task_loop.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace flow::async
3535
* ### Thread safety ###
3636
* All methods are thread-safe for read-write on a shared Concurrent_task_loop, after its ctor returns, unless
3737
* otherwise specified (but read on). This is highly significant, just as it is highly significant that boost.asio's
38-
* `Task_engine::post()` is similarly thread-safe. However, it is *not* safe to call either stop() or start()
38+
* `post(Task_engine&)` is similarly thread-safe. However, it is *not* safe to call either stop() or start()
3939
* concurrently with itself or the other of the two, on the same Concurrent_task_loop.
4040
*
4141
* ### First, select subclass to instantiate ###
@@ -64,7 +64,7 @@ namespace flow::async
6464
* - (This start/stop/run/post paradigm may be familiar to boost.asio (particularly `boost::asio::io_context`) users.)
6565
*
6666
* ### Next, post() tasks on it: create_op() to group task into operations ###
67-
* One can post() a task (in the same way one would simply `Task_engine::post()`). If one wants to execute an async
67+
* One can post() a task (in the same way one would simply `post(Task_engine&)`). If one wants to execute an async
6868
* op with 2+ non-concurrent tasks, they would pass the same async::Op to post() for each of the aforementioned 2+
6969
* `Task`s (which are simply `void` no-arg functions basically). An async::Op can be created
7070
* via create_op(); or if the task must be pinned to a specific pre-made per-software-thread async::Op,
@@ -77,7 +77,7 @@ namespace flow::async
7777
* and that should be enough for most async algorithms.
7878
*
7979
* Note also the optional `Synchronicity synchronicity` argument to the `post()` methods. By default this acts
80-
* like regular `Task_engine::post()`, but you can also access `Task_engine::dispatch()` type of behavior;
80+
* like regular `post(Task_engine&)`, but you can also access `dispatch(Task_engine&)` type of behavior;
8181
* you can wait for the task to complete using yet another mode. The latter feature,
8282
* Synchronicity::S_ASYNC_AND_AWAIT_CONCURRENT_COMPLETION, may be particularly helpful at initialization time, such
8383
* as if one needs to perform some startup tasks in the new thread(s) before continuing to general work on
@@ -315,7 +315,7 @@ namespace flow::async
315315
* is considerable flexibility available. One can think of this as a convenient wrapper around various functionality
316316
* typically used manually and separately from each other -- simplifying the core interface to just async::Op and
317317
* post() and providing automatic flexibility as to what functionality is in fact used and when as a result.
318-
* The functionality accessible: `Task_engine::post()`; scheduling via util::Strand; scheduling on specific thread;
318+
* The functionality accessible: `post(Task_engine&)`; scheduling via util::Strand; scheduling on specific thread;
319319
* non-concurrency guarantees of 2+ tasks in one async op; and thread-count selection and pinning based on available
320320
* processor architecture (hardware threads, physical cores).
321321
*/
@@ -506,7 +506,7 @@ class Concurrent_task_loop :
506506
* thread to be idle, but informally -- all else being equal -- that's a great goal.
507507
*
508508
* `synchronicity` controls the precise behavior of the "post" operation. Read #Synchronicity `enum` docs carefully.
509-
* That said: if left defaulted, `post()` works in the `Task_engine::post()` manner: return immediately; then
509+
* That said: if left defaulted, `post()` works in the `post(Task_engine&)` manner: return immediately; then
510510
* execute either concurrently in another thread or later in the same thread.
511511
*
512512
* This is safe to call after stop(), but `task()` will not run until start() (see stop() doc header).

src/flow/async/segregated_thread_task_loop.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class Segregated_thread_task_loop :
240240
// Methods.
241241

242242
/**
243-
* Helper performing the core `Task_engine::post()` (or similar) call on behalf of the various `post()` overloads.
243+
* Helper performing the core `post(Task_engine&)` (or similar) call on behalf of the various `post()` overloads.
244244
*
245245
* @param chosen_task_engine
246246
* The value `m_qing_threads[idx].task_engine().` for some valid `idx`: the engine for the thread selected

src/flow/async/single_thread_task_loop.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace flow::async
3535
* ### Thread safety ###
3636
* All methods are thread-safe for read-write on a shared Single_thread_task_loop, after its ctor returns, unless
3737
* otherwise specified (but read on). This is highly significant, just as it is highly significant that boost.asio's
38-
* `Task_engine::post()` is similarly thread-safe. However, it is *not* safe to call either stop() or start()
38+
* `post(Task_engine&)` is similarly thread-safe. However, it is *not* safe to call either stop() or start()
3939
* concurrently with itself or the other of the two, on the same Single_thread_task_loop.
4040
*
4141
* ### Rationale ###
@@ -176,7 +176,7 @@ class Single_thread_task_loop :
176176
* `Task`.
177177
*
178178
* `synchronicity` controls the precise behavior of the "post" operation. Read #Synchronicity `enum` docs carefully.
179-
* That said: if left defaulted, `post()` works in the `Task_engine::post()` manner: return immediately; then
179+
* That said: if left defaulted, `post()` works in the `post(Task_engine&)` manner: return immediately; then
180180
* execute either concurrently in another thread (if called *not* from within another in-thread task) or later in the
181181
* same thread (otherwise).
182182
*

src/flow/net_flow/asio/node.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,25 +130,25 @@ namespace flow::net_flow::asio
130130
* - Asynchronous operations (`asio::*` classes provide these):
131131
* - asio::Server_socket::async_accept() -> asio::Peer_socket: Obtain a fully connected peer socket object,
132132
* waiting as necessary in background for a connection to come in and fully establish,
133-
* then invoking user-provided callback as if by `io_context::post()`.
133+
* then invoking user-provided callback as if by `post(io_context&)`.
134134
* - Equivalent: `tcp::acceptor::async_accept()`.
135135
* - Variations: optional timeout can be specified.
136136
* - Variations: `reactor_pattern` mode, where the `accept()` call itself is left to user handler.
137137
* - asio::Node::async_connect() -> net_flow::Peer_socket: Return a fully connected peer socket object,
138138
* waiting as necessary in background to reach the remote server and fully establish connection,
139-
* then invoking user-provided callback as if by `io_context::post()`.
139+
* then invoking user-provided callback as if by `post(io_context&)`.
140140
* - Equivalent: `tcp::socket::async_connect()`.
141141
* - Variations: optional timeout can be specified.
142142
* - Variations: see also `*_with_metadata()` as above.
143143
* - asio::Peer_socket::async_send(): Queue up at least 1 of the N given bytes to send to peer ASAP,
144144
* waiting as necessary in background for this to become possible (as explained above),
145-
* then invoking user-provided callback as if by `io_context::post()`.
145+
* then invoking user-provided callback as if by `post(io_context&)`.
146146
* - Equivalent: `tcp::socket::async_send()`.
147147
* - Variations: optional timeout can be specified.
148148
* - Variations: `null_buffers` mode, where the `send()` call itself is left to user handler.
149149
* - asio::Peer_socket::async_receive(): Dequeue at least 1 of the desired N bytes from peer,
150150
* waiting as necessary in background for this to arrive from said remote peer,
151-
* then invoking user-provided callback as if by `io_context::post()`.
151+
* then invoking user-provided callback as if by `post(io_context&)`.
152152
* - Equivalent: `tcp::socket::async_receive()`.
153153
* - Variations: optional timeout can be specified.
154154
* - Variations: `null_buffers` mode, where the `receive()` call itself is left to user handler.
@@ -169,7 +169,7 @@ namespace flow::net_flow::asio
169169
* - Equivalent: `poll()` with 0 timeout.
170170
* - Event_set::async_wait(): Asynchronous I/O multiplixing, like sync_wait() but waits in background and
171171
* executes user-provided callback from an unspecified thread. (A typical callback might set a `future`
172-
* result; `io_context::post()` a task to some boost.asio event loop; perhaps set a flag that is
172+
* result; `post(io_context&)` a task to some boost.asio event loop; perhaps set a flag that is
173173
* periodically checked by some user thread; or send a byte over some quick IPC mechanism like a POSIX
174174
* domain socket or loopback UDP socket -- or even a condition variable.)
175175
* - Equivalents: none in POSIX, that I know of. Windows "overlapped" async I/O sounds vaguely like a distant
@@ -316,7 +316,7 @@ class Node :
316316
* background, and queueing the user-provided callback on the given boost.asio flow::util::Task_engine.
317317
* Acts just like connect() but instead of returning a connecting socket immediately, it returns and asycnhronously
318318
* waits until the initial handshake either succeeds or fails, and then invokes the given callback (in manner
319-
* equivalent to boost.asio `Task_engine::post()`), passing to it the connected socket or null, respectively,
319+
* equivalent to boost.asio `post(Task_engine&)`), passing to it the connected socket or null, respectively,
320320
* along with a success #Error_code or otherwise, respectively. Additionally, you can specify a timeout; not
321321
* completing the connection by that time is a specific #Error_code.
322322
*

src/flow/net_flow/asio/peer_socket.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class Peer_socket :
9292
/**
9393
* boost.asio-style asynchronous version that essentially performs non-`null_buffers`
9494
* net_flow::Peer_socket::sync_receive() in the background and invokes the given handler via the saved
95-
* `Task_engine *(async_task_engine())`, as if by `Task_engine::post()`.
95+
* `Task_engine *(async_task_engine())`, as if by `post(Task_engine&)`.
9696
*
9797
* The semantics are identical to the similar `sync_receive()`, except that the operation does not block the
9898
* calling thread; and the results are delivered to the supplied handler `on_result` instead of to the caller.
@@ -125,7 +125,7 @@ class Peer_socket :
125125
/**
126126
* boost.asio-style asynchronous version that essentially performs a `null_buffers`
127127
* net_flow::Peer_socket::sync_receive() in the background and invokes the given handler via the saved
128-
* `Task_engine *(async_task_engine())`, as if by `Task_engine::post()`.
128+
* `Task_engine *(async_task_engine())`, as if by `post(Task_engine&)`.
129129
*
130130
* The semantics are identical to the similar `sync_receive()`, except that the operation does not block the
131131
* calling thread; and the results are delivered to the supplied handler `on_result` instead of to the caller.
@@ -183,7 +183,7 @@ class Peer_socket :
183183
/**
184184
* boost.asio-style asynchronous version that essentially performs non-`null_buffers`
185185
* net_flow::Peer_socket::sync_send() in the background and invokes the given handler via the saved
186-
* `Task_engine *(async_task_engine())`, as if by `Task_engine::post()`.
186+
* `Task_engine *(async_task_engine())`, as if by `post(Task_engine&)`.
187187
*
188188
* The semantics are identical to the similar `sync_send()`, except that the operation does not block the
189189
* calling thread; and the results are delivered to the supplied handler `on_result` instead of to the caller.
@@ -216,7 +216,7 @@ class Peer_socket :
216216
/**
217217
* boost.asio-style asynchronous version that essentially performs a `null_buffers`
218218
* net_flow::Peer_socket::sync_send() in the background and invokes the given handler via the saved
219-
* `Task_engine *(async_task_engine())`, as if by `Task_engine::post()`.
219+
* `Task_engine *(async_task_engine())`, as if by `post(Task_engine&)`.
220220
*
221221
* The semantics are identical to the similar `sync_send()`, except that the operation does not block the
222222
* calling thread; and the results are delivered to the supplied handler `on_result` instead of to the caller.

src/flow/net_flow/asio/server_socket.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class Server_socket :
107107
/**
108108
* boost.asio-style asynchronous version that essentially performs
109109
* net_flow::Server_socket::sync_accept() in the background and invokes the given handler via the saved
110-
* `Task_engine *(async_task_engine())`, as if by `Task_engine::post()`.
110+
* `Task_engine *(async_task_engine())`, as if by `post(Task_engine&)`.
111111
*
112112
* The semantics are identical to the similar `sync_accept()`, except that the operation does not block the
113113
* calling thread; and the results are delivered to the supplied handler `on_result` instead of to the caller.

src/flow/net_flow/detail/drop_timer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class Drop_timer :
171171
/**
172172
* Constructs Drop_timer and returns a ref-counted pointer wrapping it. Saves the "action
173173
* callbacks" to call when various events fire in this Drop_timer. The callbacks may be placed
174-
* onto `*node_task_engine` in the manner of `Task_engine::post()`, at any future time until done()
174+
* onto `*node_task_engine` in the manner of `post(Task_engine&)`, at any future time until done()
175175
* is called. At construction, the timer is guaranteed not to fire until the first `on_...()` call.
176176
*
177177
* After construction, call `on_...()` as events occur. If an event described by the doc comment of

src/flow/net_flow/detail/port_space.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace flow::net_flow
8383
* `boost::filesystem::path`) in `~Port_space()`. This wouldn't work if Port_space crashed, however. To
8484
* solve that, we could easily start a thread in Port_space() (and join it in `~Port_space()`) that
8585
* would save that state every N seconds. If that's not enough, we can instead have that thread run
86-
* a boost.asio `io_context::run()` event loop and `io_context::post()` the save operation onto it (from
86+
* a boost.asio `io_context::run()` event loop and `post(io_context&)` the save operation onto it (from
8787
* arbitrary threads) each time a new ephemeral port is reserved (with some kind of protection
8888
* against incessant disk writing built into this worker thread; e.g., don't save if saved in the
8989
* last N msec).

src/flow/net_flow/node.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2167,7 +2167,7 @@ class Node :
21672167
* Causes an acknowledgment of the given received packet to be included in a future Ack_packet
21682168
* sent to the other side. That ACK low-level UDP packet is not sent in this handler, even if
21692169
* the low-level UDP socket is currently writable. The sending of this packet is performed
2170-
* asynchronously in the manner of `boost::asio::io_context::post()`.
2170+
* asynchronously in the manner of `boost::asio::post(io_context&)`.
21712171
*
21722172
* Note that the Ack_packet may include other packets being acknowledged; and that ACK may be
21732173
* artificially delayed for reasons like the desire to accumulate more acknowledgments before

src/flow/net_flow/peer_socket.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ Peer_socket_info Peer_socket::info() const
326326

327327
/* There are two cases. If the socket is open (not S_CLOSED), then an m_node owns it and may
328328
* change the stats we want to copy in its thread W at any time. In this case we must copy it in
329-
* thread W (which we do using a future and io_context::post(), as in listen() and other places in
329+
* thread W (which we do using a future and post(io_context&), as in listen() and other places in
330330
* Node). In the socket is closed (S_CLOSED), then no m_node owns it, so there is no thread W
331331
* applicable to this socket anymore, and we can just copy the data in thread U != W. */
332332

0 commit comments

Comments
 (0)