On Fri, Aug 5, 2016 at 8:09 PM, Boaz Segev <[email protected]> wrote: > > Your Rack app could take the socket and inject it into an > > event loop running in a separate thread. That event loop > > could be 100% C code running without GVL for all unicorn > > cares. > > > Running two (or more) event loops, each with it's own resources, is wasteful > and promotes needless context switches. > > There is no reason to hijack a socket when the server can easily provide > callbacks for IO related events using it's existing established event loop.
I suspect we're missing the forest for the trees here :) Unicorn is a forking webserver, not an event-driven or threaded webserver. Whether Unicorn ever supports the proposed standard or not, I wouldn't recommend it be used for typical applications that use WebSockets, as they usually involve persistent connections. Unicorn would quickly run out of worker processes capable of serving such connections anyway, so I question whether it's worth delving into the dirty details of IO syscalls. Best regards, --Michael
