Also funny but perhaps not too surprising:
If in my code, you replace `forkIO` by e.g. `forkOn 2`, then
nondeterministically, sometimes the program hangs and sometimes it works with
+RTS -N2.
The higher you set -N, the more likely it is to work.
If you put both the putStrLn loop and the
Niklas Hambüchen writes:
...
>
> So GHC is trying to use `O_NONBLOCK` on regular files, which cannot
> work and will block when used through unsafe foreign calls like that.
>
Yikes!
> Is this a known problem?
>
Doesn't sound familiar to me. Sounds like a ticket is in order.
Thanks
Hey Ben, thanks for your quick reply.
I think there's a problem.
On 14/05/2018 15.36, Ben Gamari wrote:
> I believe the relevant implementation is the RawIO instance defined in
> GHC.IO.FD. The read implementation in particular is
> GHC.IO.FD.readRawBufferPtr. There is a useful Note directly
Niklas Hambüchen writes:
> I just got reminded that epoll() has no effect on regular files on
> Linux by reading an nginx article [1] [2] and why that is [3] [4].
>
> By what means does the IO manager make reads (wraps around the read()
> syscall on Linux) non-blocking?
>
> Does it
I just got reminded that epoll() has no effect on regular files on Linux by
reading an nginx article [1] [2] and why that is [3] [4].
By what means does the IO manager make reads (wraps around the read() syscall
on Linux) non-blocking?
Does it always use read() in `foreign import safe` (or