Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I thought the optimization goal was latency on the parent thread so I had in mind a bare atomic_store_explicit with memory_order_relaxed. However you wouldn't care about latency in the first place if you weren't scaling this up and obviously scaling up requires additional infrastructure that I'm ignoring here.

That said the linked article is using spawn_blocking from tokio meaning you can just call vfork directly and return the result. No need to roll your own in this case.

> you can't have an event loop handle events on file descriptors _and_ condition variables

Since events crossing the kernel boundary aren't fast to begin with I prefer to use a secondary event loop for the sluggish stuff and feed the output to the lower latency one.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: