git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, "Junio C Hamano" <gitster@pobox.com>,
	"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: Re: [PATCH/RFH 0/3] stable priority-queue
Date: Mon, 14 Jul 2014 13:02:56 +0200	[thread overview]
Message-ID: <87tx6k5hjz.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <20140714054021.GA4422@sigill.intra.peff.net> (Jeff King's message of "Mon, 14 Jul 2014 01:40:22 -0400")

Jeff King <peff@peff.net> writes:

> As Junio and I discussed earlier in [1], this series makes the
> prio_queue struct stable with respect to object insertion (which in turn
> means we can use it to replace commit_list in more places).

I don't think that this makes sense in general since it assumes the
appropriate fallback behavior to be FIFO.  Depending on the use case, it
might be the other way round, or something else (like topology-based)
entirely.

commit_list may be unsuitable as such for intermingled addition of
unsorted and extraction of sorted elements (the general use case for
priority queues).

I see that struct commit already contains an integer field called
"index", assigned sequentially, which might conceivably be used for
tie-breaking independent from the actual prio_queue use at no extra
cost.

The resulting order will of course be somewhat arbitrary in a different
way, but at least will correspond to the order the commits have been
discovered/generated, so they should still exhibit a more topological
relation than what prio_queue does without further help.

-- 
David Kastrup

  parent reply	other threads:[~2014-07-14 11:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14  5:40 [PATCH/RFH 0/3] stable priority-queue Jeff King
2014-07-14  5:42 ` [PATCH 1/3] prio-queue: factor out compare and swap operations Jeff King
2014-07-14  5:51 ` [PATCH 2/3] prio-queue: make output stable with respect to insertion Jeff King
2014-07-14  5:53 ` [PATCH 3/3] paint_down_to_common: use prio_queue Jeff King
2014-07-14 10:12 ` [PATCH/RFH 0/3] stable priority-queue Duy Nguyen
2014-07-14 11:02 ` David Kastrup [this message]
2014-07-21  9:07   ` Jeff King

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=87tx6k5hjz.fsf@fencepost.gnu.org \
    --to=dak@gnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).