Skip to content

Migrate to Tokio asynchronous runtime - #218

Merged
edi-oai merged 1 commit into
mainfrom
dev/edi/tokio
Oct 22, 2026
Merged

edi-oai merged 1 commit into
mainfrom
dev/edi/tokio

Conversation

@edi-oai

@edi-oai edi-oai commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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-fd and a built-in DHCP server.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T23:04:17.983677Z 436075a PR opened
🔒 Security Review ✅ Completed 2026-10-21T23:05:38.452022Z 436075a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread lib/host.rs
ready_for_callback.notify_one();

// Park this GCD worker until drained; returning early makes vmnet repeat callbacks
let _ = callback_can_continue_rx.recv();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@edi-oai edi-oai Oct 22, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@edi-oai
edi-oai merged commit f1e82b5 into main Oct 22, 2026
2 checks passed
@edi-oai
edi-oai deleted the dev/edi/tokio branch October 22, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants