[mosh-devel] Libevent

Keith Winstein keithw at MIT.EDU
Tue May 14 10:13:45 EDT 2013


I guess the question is, what would be the benefit and would it be
painful to keep our current level of cross-platform compatibility?

It has been a pretty long journey to where we are now. We started out
using poll() and signalfd() to be able to wait for either IO or a
signal (like WINCH or INT). But signalfd() isn't available on OS X,
and on older versions of OS X don't let you poll() on a pseudo
terminal. So then we switched to a pretty complicated setup involving
skalibs, which uses either pselect() or the self-pipe trick. But that
became painful for other reasons (e.g. Debian/Ubuntu's skalibs doesn't
let you link with PIC; I didn't like distributing a big directory of
third-party code).

So now we have a nice abstraction done by Keegan that ends up calling
pselect(), which works almost everywhere. (And recently supplemented
by Jeremie to use select() on older versions of OpenBSD.)

The current approach seems to be fine so I'm not eager to revisit this
area of the code unless there would be a real benefit. And in
practice, it seems much more annoying than I had expected to rely on
these kinds of libraries, because inevitably they aren't available
somewhere we care about (e.g. Homebrew or MacPorts), which means we
need to ship a backup copy in our own tree and then keep it updated,
etc. etc.

Anyway, those are my thoughts.

-Keith

On Tue, May 14, 2013 at 8:42 AM, Timo J. Rinne <tri at iki.fi> wrote:
> Hi All
>
> While browsing through some pull requests and other stuff, I started
> wondering why Mosh event loop is in the first place implemented from
> scratch.  I think it is a model case of a program that would be best
> implemented on top of a library that hides select/poll/epoll/whatnot
> logic once and for all.
>
> It might be a painful project to turn it that way at this point, but I'm
> sure that eventually it would be worth the effort.
>
> Keith?
>
> //Rinne
> _______________________________________________
> mosh-devel mailing list
> mosh-devel at mit.edu
> http://mailman.mit.edu/mailman/listinfo/mosh-devel



More information about the mosh-devel mailing list