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

Re: [PATCH] pack-objects: document about thread synchronization

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 4, 2018, 07:04 UTC
Message-ID
<20180804070410.GD55869@aiede.svl.corp.google.com>
In-Reply-To
<20180802193518.GA29084@sigill.intra.peff.net>
Jeff King wrote:
> On Sun, Jul 29, 2018 at 05:36:05PM +0200, Nguyễn Thái Ngọc Duy wrote:
Show 8 quoted lines
>> These extra comments should be make it easier to understand how to use
>> locks in pack-objects delta search code. For reference, see
>>
>> 8ecce684a3 (basic threaded delta search - 2007-09-06)
>> 384b32c09b (pack-objects: fix threaded load balancing - 2007-12-08)
>> 50f22ada52 (threaded pack-objects: Use condition... - 2007-12-16)
>
> Thanks, I think this is an improvement.
Yes,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
as well.

Usually I would prefer to see comments about what lock protects some state where the state is defined, but here the state is normally not protected by any lock, since Git is single-threaded except in limited places (like pack-objects). So the documentation you added is in the right place today, even though it's an unusual place.

Longer term, if we start using more multithreading in Git, we'll have to reconsider how to structure the locking anyway.

Thanks, Jonathan

Previous: Jeff King
Message 6 of 6 in “pack-objects: document about thread synchronization”
  1. pack-objects: document about thread synchronizationNguyễn Thái Ngọc Duy, Jul 29, 2018
  2. Duy NguyenJul 29, 2018
  3. Jeff KingAug 2, 2018
  4. Duy NguyenAug 4, 2018
  5. Jeff KingAug 2, 2018
  6. Jonathan NiederAug 4, 2018

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.