Re: [PATCH] compat: Allow static initializer for pthreads on Windows
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Oct 27, 2016, 18:22 UTC
- Message-ID
- <34c88c40-2088-fd74-5d26-56c0599b7eb9@kdbg.org>
- In-Reply-To
- <CAGZ79kbP3pgPHgv-x1Q-Q1QwmXc=gOyxWhXh2SngO8WSZc3PFA@mail.gmail.com>
Am 27.10.2016 um 19:01 schrieb Stefan Beller:
Show 7 quoted lines
>> Johannes Sixt <j6t@kdbg.org> writes: >> This is the pessimization that I am talking about. I would not mind at all if >> it were only for the attribute subsystem, but the proposed patch would >> pessimize *all* uses of pthread_mutex_lock. > > It would only pessimize *uninitialized* mutexes? For initialized mutexes > the added burden is super cheap (one additional condition).
It is not possible to mark a mutex uninitialized on Windows without an extra piece of data. A solution would become quite complicated quite quickly, and at the cost of additional operations that are in the same ballpark as an uncontended mutex. I'm not enthused.
Show 6 quoted lines
> The positive aspect of this way the patch proposes would be that any > future contributor not knowing the details of how to do mutexes right > on Windows, would not totally break the whole system, i.e. this seems > to be more maintainable in the future as it reduces the friction between > pthreads mutexes and the way we can do things in Git in a platform > independent way
This is a non-argument. Coders have to know their tools.
-- Hannes