Summary

with-input-from-pipe should be rewritten so it does not block

Metadata

Description

The current implementation of with-input-from-pipe is straightforward and uses the underlying POSIX functions popen and pclose.

However the usage of pclose will wait for the child process of the pipe to exit and thus will hang the whole chicken process.

This gets in the way if threading is used.

Therefore it should be implemented in a way that we explicitly wait for the SIGCHLD to arrive in the scheduler. Maybe a thread-wait-for-signal mechanism needs to be implemented.

This will complicate a lot of things so I will put this on the back burner for now.

Changes and comments

[2015-05-01 09:45:14 UTC] evhan wrote:

It looks like in order to do this we'd have to reimplement these procedures in terms of ##sys#process or some other variant of pipe/fork/exec, as AFAIK there's no way to poll for exit with just a file handle. But, if it'll take a rewrite anyway, these might be good candidates for eggification. sjamaan, the posix unit is your bugbear -- do you have an opinion?

[2016-08-25 21:48:19 UTC] sjamaan set difficulty to hard