[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: dangerous hash usage?

From: mark benedetto king <mbk_at_lowlatency.com>
Date: 2003-09-25 15:36:20 CEST

On Wed, Sep 24, 2003 at 03:47:16PM -0700, Jack Repenning wrote:
> At 5:40 PM -0500 9/24/03, Ben Collins-Sussman wrote:
> >
> >If you send a patch against APR HEAD, one of us can commit the docfix
> >to APR.
>
> Someone should first figure out what the truth is. Julian provided
> two possibilities; actually my reading of the comment suggested yet a
> third.

The truth (as it appears to me) is that (ignoring multi-threading issues):

removes are totally safe, even with open iterators.
note: if an iterator hasn't seen the removed element yet, it won't.

adds are dangerous with open iterators, because of this:
not only might an open iterator not see the added element, it might not
see a large fraction of the other elements of the hash, and it might see
some elements that it has already seen again! this is because an add can
cause a rehash.

--ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 25 15:37:51 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.