All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Sixt <j.sixt@viscovery.net>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Duy Nguyen <pclouds@gmail.com>
Subject: Re: [PATCH] lookup_object: prioritize recently found objects
Date: Fri, 03 May 2013 07:59:09 +0200	[thread overview]
Message-ID: <5183522D.5060405@viscovery.net> (raw)
In-Reply-To: <20130502154618.GA18462@sigill.intra.peff.net>

Am 5/2/2013 17:46, schrieb Jeff King:
> 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

  reply	other threads:[~2013-05-03  5:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-01 20:34 [PATCH] lookup_object: prioritize recently found objects Jeff King
2013-05-01 21:57 ` Junio C Hamano
2013-05-02  6:44 ` Johannes Sixt
2013-05-02  6:46   ` Jeff King
2013-05-02  7:05     ` Johannes Sixt
2013-05-02 15:46       ` Junio C Hamano
2013-05-02 15:50         ` Jeff King
2013-05-02 15:46       ` Jeff King
2013-05-03  5:59         ` Johannes Sixt [this message]
2013-05-03  6:02           ` Jeff King
2013-05-03  6:16             ` Jeff King
2013-05-02 15:38     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5183522D.5060405@viscovery.net \
    --to=j.sixt@viscovery.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.