Skip to content

streamingProcess does not work with non-threaded runtime #40

@nh2

Description

@nh2

In the non-threaded runtime, the waitForProcess (waitpid()) call used in streamingProcess blocks the entire Haskell process, thus making the program block forever if the child process needs to be fed input by Haskell in order to terminate.

This is because waitpid() is not Fd-based and thus cannot use the non-blocking IO of the IO manager; see the waitForProcess docs here:

GHC Note: in order to call waitForProcess without blocking all the other threads in the system, you must compile the program with -threaded.

Detail repro with explanation: https://github.com/nh2/sourceProcessWithStreams-nonthreaded-problem

I use the nonthreaded runtime a lot, and I also use streamingProcess and conduits on top of it, so I'd like those to work with each other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions