git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] compat: Allow static initializer for pthreads on Windows

From
Jacob Keller <jacob.keller@gmail.com>
Date
Oct 27, 2016, 21:49 UTC
Message-ID
<CA+P7+xpckfaeHmoEGQBdLD-=Kf7gQ-jOxGFKrKmiFH1SBN7GjA@mail.gmail.com>
In-Reply-To
<a2e5acd6-485d-0387-7a85-6042dee702f7@kdbg.org>
On Thu, Oct 27, 2016 at 1:05 PM, Johannes Sixt <j6t@kdbg.org> wrote:
Show 11 quoted lines
>> The implementation under discussion (well we did not discuss the
>> implementation a
>> whole lot yet) ...
>
>
> There's not a whole lot to discuss: it must be rewritten from scratch (it's
> not just the memory barriers, it is everything else, too). But time is much
> better spent on an attr_start() solution.
>
> -- Hannes
>

Ok, so I've been reading this thread. I don't understand your objections to emulating in this way.. Could you clearly spell out why you believe this solution isn't acceptable? So far all I've understood was "it's not critical sections" and "it penalizes Windows too much" but... If Windows cannot statically initialize a pthread mutex, then we *have* to dynamically initialize it somewhere. This solution adds a single check before each lock and is safe due to use of memory barriers. Yes, this will cost a tiny bit extra overhead for each use of "pthread_mutex_lock" but I fail to see how that is a huge penalty...

So I'm trying to understand if that really is your only concern, because I don't actually buy that it is a huge overhead to pay.

I agree with Stefan that there isn't really a great place to put a dynamic initialization.

To be clear I am trying to understand the objections since so far all I have read is "this is bad, and I object" without clearly explaining reasoning.

Regards, Jake

Previous: Johannes SixtNext: Stefan Beller
Message 15 of 28 in “compat: Allow static initializer for pthreads on Windows”
  1. compat: Allow static initializer for pthreads on WindowsStefan Beller, Oct 26, 2016
  2. Stefan BellerOct 26, 2016
  3. Johannes SixtOct 27, 2016
  4. Junio C HamanoOct 27, 2016
  5. Johannes SixtOct 27, 2016
  6. Junio C HamanoOct 27, 2016
  7. Johannes SixtOct 27, 2016
  8. Junio C HamanoOct 27, 2016
  9. Stefan BellerOct 27, 2016
  10. Jeff KingOct 27, 2016
  11. Johannes SixtOct 27, 2016
  12. Junio C HamanoOct 27, 2016
  13. Stefan BellerOct 27, 2016
  14. Johannes SixtOct 27, 2016
  15. Jacob KellerOct 27, 2016
  16. Stefan BellerOct 27, 2016
  17. Johannes SixtOct 28, 2016
  18. Jacob KellerOct 28, 2016
  19. Philip OakleyOct 28, 2016
  20. Jacob KellerOct 28, 2016
  21. Johannes SchindelinOct 28, 2016
  22. Jacob KellerOct 28, 2016
  23. Johannes SixtOct 28, 2016
  24. Junio C HamanoOct 28, 2016
  25. Stefan BellerOct 28, 2016
  26. Junio C HamanoOct 28, 2016
  27. Johannes SixtOct 28, 2016
  28. Junio C HamanoOct 28, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.