[Top][All Lists]

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

Multiple concurrent coprocesses

From: Zachary Santer
Subject: Multiple concurrent coprocesses
Date: Sat, 20 Mar 2021 11:47:01 -0400

Multiple concurrent coprocesses simplified one of my scripts a good bit,
and then I ran into this
Considering a decade has passed, I'm assuming the ship has kind of sailed
on Chet finishing support for it, so I'm curious what's missing. I might
like to submit my own patch.

I'm working with Bash 4.2 at my day job, though. Multiple
concurrent coprocesses replaced dynamically creating different sets of
FIFOs and creating automatic file descriptors for those FIFOs in the parent
process and subprocesses, so anything simpler than that would be nice.

On freenode #bash, I got the following advice:
> it's possible to dup the fd's for the coprocess and close the originals,
then close the coproc (which keeps running) and start a new one
> it's not just avoiding the error message, it's actually guaranteed to
work with or without support for multiple coprocesses

Is that true? Is this a safe approach?

Is closing the file descriptors that the coproc keyword generates not
sufficient to close the coproc?

Thanks for your help.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]