Files
RedBear-OS/netstack
Red Bear OS 30a8db93e0 netstack: comprehensive CORE-C12 per-NIC reader pool
Complete, self-contained Phase 7 / CORE-C12 module:

- Packet type and worker_loop helper for the per-NIC read
  path with proper error handling on worker exit.
- ReaderPool::spawn takes a Vec<File> and spawns one worker
  thread per file. Each thread blocks on a blocking read,
  sends the bytes through an mpsc::Sender, and the main
  smolnetd event loop drains the receiver on each iteration.
- drain (non-blocking) and recv (blocking) methods on the
  receiver. Both return cleanly when the channel disconnects
  (worker exited).
- Drop impl joins the worker threads; the pool is fully
  owned by a single thread, only the I/O is parallel.
- Unit test pool_sends_packets exercises the round-trip
  through a temp-file scheme fixture, with proper locking
  via std::sync::Mutex on a static FAKE buffer.

The smolnetd main loop integration is intentionally
deferred to a follow-up patch: netstack currently uses
libredox::Fd throughout, and the worker pool needs
std::fs::File. Converting libredox::Fd to a std::fs::File
across the scheme accessors is a one-time migration; once
that lands the ReaderPool can be wired into the main event
loop and CORE-C12 is fully implemented.
2026-07-26 23:35:03 +09:00
..