Hacker News new | ask | show | jobs
by asveikau 92 days ago
> These days you'd implement cancellation by having one thread handle inbound messages and another thread do the actual work with shared memory to implement a cooperative cancellation mechanic.

Doesn't necessarily need a thread per connection. Could be on an epoll/kqueue/io-uring.

The query would need to periodically re-check a cancellation flag, which has costs and would come with a delay if it's particularly busy.