On 2017/9/28 7:37, JonY wrote:
Does it make sense to use a global lock in mingw_ansi_fputs?


I was thinking about a named Mutex object. Named Mutexes (as well as Events and Semaphores) can be shared across processes, but there are other considerations:

1. The name of the Mutex should base on the current console window which is shared by all child processes created by `make`, and must be unique. How can it be? Is it possible to create a string basing on the window handle or unique identifier whatsoever? Will the handle or unique id be reused after the window is destroyed? Is it unique after all?

2. This Mutex would only protect diagnostics from interleaving. Diagnostics can interleave with other messages written via stdio functions, including those written to `stdout` which is often output to the console as well. I don't think there are any solutions for this.

--
Best regards,
LH_Mouse

Reply via email to