logo       

Use of synchronized in scala.Iterator.duplicate?: msg#00408

lang.scala

Subject: Use of synchronized in scala.Iterator.duplicate?

I was a little bit surprised to see synchronization used in the
implementation of scala.Iterator.duplicate, particularly seeing as only
the explicitly synchronized collections in scala.collections.mutable
make use any synchronization at all.

Granted there's state here, but given that the underlying collection
isn't in general thread-safe it looks like the sync in duplicate is
giving a false sense of security ...

Cheers,


Miles



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise