News for hackers. Stuff that matters.
Re:Creator of Raft Algorithm introduces LogCabin by ongardie on Tuesday May 05, 2015 @12:16AM (#9490814)
LogCabin uses its event loop for network operations but then hands requests off to threads to process. I started out with libevent2, but the problem is it doesn't deal with having multiple threads very well (error-prone and inefficient). It's also not as well-documented as the man pages for epoll, so I ended up using epoll directly instead. What was really lost in the libevent2 -> epoll conversion was platform independence, but I think it might be better to get that back through well-placed #ifdefs or relying on some other library; I wouldn't go back to libevent2.
Re:Creator of Raft Algorithm introduces LogCabin by mpercy on Tuesday May 05, 2015 @03:47AM (#9491335)
We're using libev (actually libev++ which is cross-platform, has a decent underlying C impl, and a C++ bridge API). It seems to work well and is fast and cross platform. It can be a little tricky to figure out what is going on with the C++ API sometimes due to how the author tacked it on using macros.
Re:Creator of Raft Algorithm introduces LogCabin by justinmk on Tuesday May 05, 2015 @01:30AM (#9491007)
> What was really lost in the libevent2 -> epoll conversion was platform independence

Did you consider libuv?

Re:Creator of Raft Algorithm introduces LogCabin by ongardie on Tuesday May 05, 2015 @02:59AM (#9491199)
I guess the answer is no, I haven't really looked at it. Anyone have experience with it in a large-ish project outside of Node?
Re:Creator of Raft Algorithm introduces LogCabin by apaprocki on Tuesday May 05, 2015 @04:49AM (#9491489)
Yes -- it is very straightforward to use and "just works". (It is also used in a similar way as found in Node in the luvit project: https://github.com/luvit/luvit)