Re: [PATCH v2 1/1] index-pack: Disable threading on cygwin
- From
Erik Faye-Lund <kusmabite@gmail.com>
- Date
- Jun 26, 2012, 22:57 UTC
- Message-ID
- <CABPQNSaqxouhpsHBN5uVCiaRpkuR65uNNn6c30CxEx3zGbJrSg@mail.gmail.com>
- In-Reply-To
- <7v62adaee3.fsf@alter.siamese.dyndns.org>
On Wed, Jun 27, 2012 at 12:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> Erik Faye-Lund <kusmabite@gmail.com> writes: > >> On Tue, Jun 26, 2012 at 9:56 PM, Junio C Hamano <gitster@pobox.com> wrote: >>> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes: >>> >>>> - renamed FAKE_PREAD_NOT_THREAD_SAFE to NO_THREAD_SAFE_PREAD >>> >>> Sensible. >>> >>>> - when NO_PREAD, set NO_THREAD_SAFE_PREAD in the Makefile, rather >>>> than in git-compat-util.h >>> >>> I think it is a bad change. When compat/ pread gets improved to be >>> thread-safe, this will surely be missed. >> >> But CAN it be fixed? I don't think it could, at least not without >> wrapping ALL calls to functions that perform IO on file handles or >> file descriptors... > > Is that relevant? It may be true that both Erik and Junio are not > being clever enough to come up with a solution offhand. But is that > a good justification to go against a sound engineering practice? >
I didn't really mean to argue for or against this particular solution, sorry if I was unclear. I'm more interested in actually fixing the issue without disabling threading ;)
At least on Windows, the CRT actually does take a lock for the file-handle for all standard IO opterations. Perhaps we can somehow take it ourselves? I'm not entirely sure how to get hold of it, but it would probably require quite a deep-dive into the CRT sources...