Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: immutable BigInteger



You are incorrect when you state that any program that is not thread safe is incorrect.

This is against the reason that StringBuilder and other classes were added to the JDK - to remove the thread safety implemented by StringBuffer.

Many programs are not multi-threaded, and the "internal threads" of the JVM are hidden.

By making the synchronization external, then more higher performance can be achieved, since you do not synchronize structures that do not need to be synchronized.

Now, a REALLY good JVM can probably optimize away the synchronize calls in some cases, but even then it is not going to be as perfect as the designer explicitly stating up front what synchronization is required.

It is usually simple enough to state on a class "This class is not thread safe", although that is usually the default for UI classes, so they usually state the opposite.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.