Opened 4 years ago

Last modified 2 years ago

#1134 new enhancement

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

Reported by: ckeen Owned by:
Priority: not urgent at all Milestone: someday
Component: core libraries Version: 4.9.x
Keywords: posix with-input-from-pipe pclose block threads Cc:
Estimated difficulty: hard

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.

Change History (2)

comment:1 Changed 3 years ago by evhan

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?

comment:2 Changed 2 years ago by sjamaan

  • Estimated difficulty set to hard
Note: See TracTickets for help on using tickets.