logoalt Hacker News

C-events, yet another event loop, simpler, smaller, faster, safer

57 pointsby thetechstech12/26/202511 commentsview on HN

Comments

emersionyesterday at 10:13 PM

My go-to small event loop library is https://github.com/any1/aml

kevin_thibedeauyesterday at 8:06 PM

  void *rwtask(param_t v) {
   ...
   a = v->int_ptr;
   ...
   free(a);
It seems architecturally unwise to have a callback responsible for freeing its parameters. At the very least this fossilizes dependency on the stdlib heap.
show 1 reply
mgaunardyesterday at 7:17 PM

Why not io_uring? That's the biggest game changer.

I guess because it's not possible to abstract away as much.

show 2 replies
miguel_martinyesterday at 11:12 PM

See also: Nim's std/selectors API - https://nim-lang.org/docs/selectors.html, it supports: "Supported features: files, sockets, pipes, timers, processes, signals and user events." - here's a HTTP server event loop using it: https://github.com/guzba/mummy/blob/master/src/mummy.nim#L11...

cryptonectoryesterday at 11:23 PM

Nice! I could use this :) (for open source work).

Though I would prefer to have something not based on coroutines.