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

Re: [JGIT RFC PATCH 2/2] Rewrite WindowCache to be easier to follow and maintain

From
Shawn O. Pearce <spearce@spearce.org>
Date
Apr 29, 2009, 17:16 UTC
Message-ID
<20090429171659.GF23604@spearce.org>
In-Reply-To
<200904290120.00039.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
Show 10 quoted lines
> > diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/OffsetCache.java b/org.spearce.jgit/src/org/spearce/jgit/lib/OffsetCache.java
> > +	private void gc() {
> > +		R r;
> > +		while ((r = (R) queue.poll()) != null) {
> > +			// Sun's Java 5 and 6 implementation have a bug where a Reference
> > +			// can be enqueued and dequeued twice on the same reference queue
> > +			// due to a race condition within ReferenceQueue.enqueue(Reference).
> 
> Reference to the official Sun bug? Might help if someone wants to
> implement a flag to avoid this (if necessary...)

Actually, this is a new bug. I tried looking through BugParade but nobody has mentioned or discovered this before.

I submitted a bug report yesterday, but they have yet to publish it.
So, no link.
 
Show 5 quoted lines
> > +	protected int hash(final int packHash, final long position) {
> > +		return (packHash + (int) (position >>> 4)) >>> 1;
> > +	}
>
> Since we never use the baselass this one isn't covered... ok anyway I think.

This particular implementation I planned on using in UnpackedObjectCache if I rewrote it using OffsetCache.

But I could also just make it abstract here.  Maybe that is the
better approach.  I'll amend that into the series.
 
-- 
Shawn.
Previous: Shawn O. PearceNext: Ferry Huberts (Pelagic)
Message 6 of 8 in “Don't use ByteWindows when checking pack file headers/footers”
  1. 1/2 Don't use ByteWindows when checking pack file headers/footersShawn O. Pearce, Apr 28, 2009
  2. 2/2 Rewrite WindowCache to be easier to follow and maintainShawn O. Pearce, Apr 28, 2009
  3. Shawn O. PearceApr 28, 2009
  4. Robin RosenbergApr 28, 2009
  5. Shawn O. PearceApr 28, 2009
  6. Shawn O. PearceApr 29, 2009
  7. Ferry Huberts (Pelagic)Apr 30, 2009
  8. Link to the Sun JVM bug mentioned in OffsetCacheShawn O. Pearce, May 6, 2009

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.