[Lldb-commits] [PATCH] D31823: Update LLDB Host to support IPv6 over TCP
Pavel Labath via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Apr 12 03:54:59 PDT 2017
labath added a comment.
In https://reviews.llvm.org/D31823#724334, @beanz wrote:
> @labath, I could adapt this into the `MainLoop` class, but I would actually want to change how that class hierarchy is implemented. Regardless of the event handling/polling model you use much of the code is identical between the classes. I'd rather get rid of `MainLoopPosix` and `MainLoopBase` and instead just implement a portable `MainLoop` class.
> In particular the difference between Windows `WSAPoll` and posix `poll(2)` is the name of two functions, which makes the idea of having separate Windows and Posix implementations just seem overly complicated to me, although neither Darwin nor Windows have `ppoll` because it isn't POSIX, and Windows doesn't have `pselect`, so there isn't a remotely portable way to wait on file descriptors and signals... This is why we can't have nice things.
One extra thing you should be aware of is that unlike poll(2), WSAPoll only works on sockets. We currently have pieces of code ifdef-ed out on windows because we have no way to wait on pipes, and eventually I'd like to teach the MainLoop to do that as well. I'm not saying we should do that now, just pointing out that the implementations are likely to diverge in the future.
However, if you think that for the current minimal requirements (sockets on windows, signals and file descriptors on linux and netbsd, and file descriptors everywhere else) the cleanest implementation is a single class, then that's fine with me. We can revisit that decision when the need comes up.
More information about the lldb-commits