createProcess package:concurrent-output

Wrapper around createProcess that prevents multiple processes that are running concurrently from writing to stdout/stderr at the same time. If the process does not output to stdout or stderr, it's run by createProcess entirely as usual. Only processes that can generate output are handled specially: A process is allowed to write to stdout and stderr in the usual way, assuming it can successfully take the output lock. When the output lock is held (ie, by another concurrent process, or because outputConcurrent is being called at the same time), the process is instead run with its stdout and stderr redirected to a buffer. The buffered output will be displayed as soon as the output lock becomes free. Note that the the process is waited for by a background thread, so unlike createProcess, neglecting to call waitForProcess will not result in zombie processess.
Wrapper around createProcess that makes sure a process is run in the foreground, with direct access to stdout and stderr. Useful when eg, running an interactive process. Note that the the process is waited for by a background thread, so unlike createProcess, neglecting to call waitForProcess will not result in zombie processess.