Follow-up Comment #2, bug #52922 (project make): I spent a while longer looking at this, and being reminded of how messy UNIX locking is.
* On FreeBSD, none of fcntl-locks, flock(), and lockf() work on pipes. * POSIX reminds me that write() is atomic on regular files. If make were to carefully accumulate and concatenate output for stdout and stderr into buffers, and then write() entire buffers, make might not need locking at all for regular files. Of course, buffers of unbounded size would be a problem here. * Network file systems have varying support for locking. I think having either a lock file or a POSIX semaphore to share with children is probably the best way to handle this. This loses the redirected-children-dont-lock property, but in output_dump() make is pretty much just copying the temporary output and doing fairly simple sprintfs for its own output. That should go fairly fast most of the time, and I'd guess concurrency wouldn't be a major problem, except for really pathological cases such as very large numbers of targets or very large output from targets. _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?52922> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make