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

Re: [PATCH] lookup_object: prioritize recently found objects

From
Johannes Sixt <j.sixt@viscovery.net>
Date
May 3, 2013, 05:59 UTC
Message-ID
<5183522D.5060405@viscovery.net>
In-Reply-To
<20130502154618.GA18462@sigill.intra.peff.net>
Am 5/2/2013 17:46, schrieb Jeff King:
Show 11 quoted lines
> On Thu, May 02, 2013 at 09:05:01AM +0200, Johannes Sixt wrote:
>> BTW, do you notice that the function is now modifying an object (the hash
>> table) even though this is rather unexpected from a "lookup" function?
> 
> I think this is fine. The function is conceptually constant from the
> outside; callers don't even know about the hash table. They just know
> that there is some mapping. It's similar to the way that lookup_commit
> will lazily allocate the "struct commit". The callers do not care
> whether it exists already or not; they care that at the end of the
> function, they have a pointer to the commit. Everything else is an
> implementation detail.

Can we be sure that the function is never invoked in concurrently from different threads? I attempted to audit code paths, but quickly gave up because I know too little about this machinery.

-- Hannes
Previous: Jeff KingNext: Jeff King
Message 9 of 12 in “lookup_object: prioritize recently found objects”
  1. lookup_object: prioritize recently found objectsJeff King, May 1, 2013
  2. Junio C HamanoMay 1, 2013
  3. Johannes SixtMay 2, 2013
  4. Jeff KingMay 2, 2013
  5. Johannes SixtMay 2, 2013
  6. Junio C HamanoMay 2, 2013
  7. Jeff KingMay 2, 2013
  8. Jeff KingMay 2, 2013
  9. Johannes SixtMay 3, 2013
  10. Jeff KingMay 3, 2013
  11. Jeff KingMay 3, 2013
  12. Junio C HamanoMay 2, 2013

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.