Repository navigation
Migrate to Tokio asynchronous runtime - #218
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| ready_for_callback.notify_one(); | ||
|
|
||
| // Park this GCD worker until drained; returning early makes vmnet repeat callbacks | ||
| let _ = callback_can_continue_rx.recv(); |
There was a problem hiding this comment.
nit: just for my own understanding
I recall usually we shouldn't be blocking global queue since that may allow GCD to spawn more threads, is this intentional to occupy until drain?
There was a problem hiding this comment.
From Softnet's point-of-view, we've had the same logic before in order to prevent repeated readiness callbacks, so not much is changing here.
From GCD point-of-view, this is a good catch! It may indeed result in pool compensation by spawning one extra thread.
I initially did it this way thinking that it'd be clearly more CPU waste to unregister/register the callback each time, but I think it's worth actually benchmarking this to see if we can further speed up and/or simplify things.
Still, let's address this separately as this is an improvement to pre-existing logic.
The overall goal here is to simplify polling and concurrency management.
This is becoming increasingly important as Softnet handles more functionality beyond basic packet processing, such as the
--control-fdand a built-in DHCP server.