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

Re: [PATCH/RFH 0/3] stable priority-queue

From
David Kastrup <dak@gnu.org>
Date
Jul 14, 2014, 11:02 UTC
Message-ID
<87tx6k5hjz.fsf@fencepost.gnu.org>
In-Reply-To
<20140714054021.GA4422@sigill.intra.peff.net>
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
Previous: Duy NguyenNext: Jeff King
Message 6 of 7 in “stable priority-queue”
  1. 0/3 stable priority-queueJeff King, Jul 14, 2014
  2. 1/3 prio-queue: factor out compare and swap operationsJeff King, Jul 14, 2014
  3. 2/3 prio-queue: make output stable with respect to insertionJeff King, Jul 14, 2014
  4. 3/3 paint_down_to_common: use prio_queueJeff King, Jul 14, 2014
  5. Duy NguyenJul 14, 2014
  6. David KastrupJul 14, 2014
  7. Jeff KingJul 21, 2014

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.