[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Help sought for shelltestrunner and threads issue



Hi all,

I'm stumped and don't know how to proceed, so some feedback is welcome.

While trying to update shelltestrunner, I realised that it requires
indeed a threaded runtime, it was not optional as I thought.

The problem is that hGetContents from two threads (one on the stdout of
a child process and one on the stderr) will 'break' in non-threaded mode
if the output is bigger than what a pipe can 'hold'. If I understand
correctly, hGetContents will not actually force the read (not even for
strict bindings, i.e. !s <- hGetContents fd) so the child process will
be stuck on writing stdout, while the parent tries to read stderr,
leading to a deadlock.

So, the options are:

- patch heavily shelltestrunner and find a way to make it work without
  -threaded; but I'm not sure I can fix this reliably and cleanly
- leave things as is, but then shelltestrunner will be broken in _some
  cases_ on non-threaded platforms
- restrict it to platforms which have a threaded runtime (is there such
  a list?)

Any ideas?

thanks,
iustin

Attachment: signature.asc
Description: Digital signature


Reply to: