On 11/12/2010 12:00 PM, Florian Weimer wrote:
Lew:
>> I do not know of any interface that requires its implementations to be
>> thread safe, anywhere in Java. The closest I can think of is the JPA
>> javax.persistence.EntityManagerFactory, all extant implementations of
>> which are thread-safe, but of course the interface cannot require
>> that.
>>
>> Can you think of one that does?
> java.util.concurrent.BlockingQueue and many others from the
> java.util.concurrent package. This is not enforced by the language,
> of course.
And therefore does not require implementations to be thread safe, as I stated.
Even the documentation for 'BlockingQueue' makes that point: "BlockingQueue
implementations are thread-safe." Not the interface, only its implementations
are thread safe, and implicitly only the ones known at the time the Javadoc
comments were written.
--
Lew