What IO activity does the GHC IO manager support?

Any file descriptor that can be managed by epoll/kqueue is eligible. Libraries that want asynchronous treatment of I/O need to cooperate with the I/O manager by

  • making file descriptors non-blocking, and
  • calling the threadWaitRead and threadWaitWrite functions in GHC.Conc before retrying a system call that previously returned EWOULDBLOCK.

This has already been done for the Handle and Socket types. If you use e.g. a binding to a C database library you will get blocking behavior as that library won’t cooperate with the I/O manager.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)