commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [SUBMIT][Collections] Buffer stuff from Avalon
Date Thu, 27 Jun 2002 20:58:55 GMT
From: "Michael A. Smith" <mas@apache.org>
> On Thu, 27 Jun 2002, Stephen Colebourne wrote:
> > In the synchronizedBuffer implementation, the iterator() method should
> > probably NOT be synchronized. The equivalent in java.util.Collections
isn't
> > and has a suitable comment instead.
>
> I've always thought it was weird that the interator was unsynchronized.
> There's no reason each method on the iterator can't synchronize on the
> appropriate object to ensure consistency in a multi-threaded
> environment.  But, alas, Sun decided against it and just added a
> comment.  I haven't had a chance to look at what Paul put together, but
> I'm inclined to agree with Stephen here that we should behave similarly
> to java.util.Collections.synchronizedFoo().

I understood that the correct way to syncgronize was
synchronize (list) {
  for (Iterator it = list.iterator(); it.hasNext();) {
  ...
  }
}
Maybe I'm wrong...

> > Also, should BoundedFifo be named BoundedFifoBuffer? and the same with
> > Unbounded? If not, then the naming proposal needs a minor alteration.
(and
> > it should probably be voted on again)
>
> Speaking of the naming proposal, have you had a chance to write
> something up?  I'm fairly certain I will have time this weekend, but
> don't want to duplicate effort if you've already gotten something put
> together that you just haven't finished/submitted yet.

Submitted a few days ago
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-dev@jakarta.apac
he.org&msgId=377897

Stephen


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message