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

Re: [RFC] Thread safety in some low-level functions

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Jun 25, 2020, 01:38 UTC
Message-ID
<20200625013851.GA9782@camp.crustytoothpaste.net>
In-Reply-To
<CAHd-oW5jCWeWDcMhLU2Zf96uTtxLehVsM+StDC8LZga282cDjw@mail.gmail.com>
On 2020-06-24 at 22:52:58, Matheus Tavares Bernardino wrote:
Show 17 quoted lines
> On Wed, Jun 24, 2020 at 7:29 PM Matheus Tavares Bernardino
> <matheus.bernardino@usp.br> wrote:
> >
> > - Regarding, oid_to_hex(), a patch from 2010 [1] proposed a solution
> > using thread-local storage and pthread_once(). But as Hannes pointed
> > out in this other thread [2] , implementing a Windows equivalence for
> > pthread_once() could be tricky and voluminous. Since this thread dates
> > from 7 years ago, I was wondering if we would be able to implement it
> > nowadays with InitOnceExecuteOnce() [3].
> 
> I forgot to link it before, but here is a commit in libav.git which
> emulates pthread_once():
> https://git.libav.org/?p=libav.git;a=commitdiff;h=b22693b06d1e5d73454a65c203b4d31c1ca5b69a
> 
> The patch is not so big, and if we consider only Vista+, it seems very
> straightforward. I'm not very familiar with Windows, though, and I'm
> not sure if this solution would work for us.

I believe Git for Windows dropped support for Windows XP some time back. Regardless, since pretty much nobody using Windows XP (with the possible exception of ATMs) is getting security support, I'm fine with ignoring it either way. I am also not a Windows person, so others may have more insight.

As for the general idea, I'm mildly in favor of it. While I don't plan to work on the project myself (outside of cleaning up places I'm already working), I'm definitely not opposed to seeing patches come in to improve thread safety.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Matheus Tavares BernardinoNext: Matheus Tavares
Message 3 of 25 in “[RFC] Thread safety in some low-level functions”
  1. Matheus Tavares BernardinoJun 24, 2020
  2. Matheus Tavares BernardinoJun 24, 2020
  3. brian m. carlsonJun 25, 2020
  4. 0/2 Make oid_to_hex() thread-safeMatheus Tavares, Jun 25, 2020
  5. 1/2 compat/win32/pthread: add pthread_once()Matheus Tavares, Jun 25, 2020
  6. Christian CouderJun 26, 2020
  7. Matheus Tavares BernardinoJun 26, 2020
  8. 2/2 hex: make hash_to_hex_algop() and friends thread-safeMatheus Tavares, Jun 25, 2020
  9. brian m. carlsonJun 25, 2020
  10. Matheus Tavares BernardinoJun 25, 2020
  11. Matheus Tavares BernardinoJun 26, 2020
  12. Christian CouderJun 26, 2020
  13. Christian CouderJun 26, 2020
  14. Matheus Tavares BernardinoJun 26, 2020
  15. 0/2 Make oid_to_hex() thread-safeMatheus Tavares, Jun 26, 2020
  16. 1/2 compat/win32/pthread: add pthread_once()Matheus Tavares, Jun 26, 2020
  17. 2/2 hex: make hash_to_hex_algop() and friends thread-safeMatheus Tavares, Jun 26, 2020
  18. Johannes SchindelinJun 29, 2020
  19. Matheus Tavares BernardinoJun 30, 2020
  20. Johannes SchindelinJul 1, 2020
  21. Johannes SchindelinJul 16, 2020
  22. Matheus Tavares BernardinoJul 18, 2020
  23. Johannes SchindelinAug 10, 2020
  24. Matheus TavaresJul 18, 2020
  25. René ScharfeJul 26, 2020

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.