How to use the epoll/kqueue enabled version of GHC

2019-06-04 21:28发布

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条回答
Luminary・发光体
2楼-- · 2019-06-04 21:37

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.

查看更多
登录 后发表回答