问题
There is a lot of old information on the net regarding an epoll/kqueue enabled GHC. For example, the code on the Simple Servers wiki page doesn't compile anymore.
Could someone provide a basic example of how to use this feature with a modern GHC version to build, e.g. a TCP server that just responds with "Hello" on connect?
回答1:
GHC's IO manager uses epoll/kqueue under the hood without any special programmer effort. Just write the naive threaded program -- that puts each concurrent blocking IO call in a separate thread -- and GHC will make sure it works out the way you want it to.
来源:https://stackoverflow.com/questions/34031039/how-to-use-the-epoll-kqueue-enabled-version-of-ghc-haskell-for-network-connectio