Ivanov, Alexey A wrote:
From: Nathan Beyer [mailto:[EMAIL PROTECTED]
Do you know of any specific examples of code that's required to be
thread
safe?
Yes, I do. For example: javax.swing.text.AbstractDocument.remove,
.insertString, .createPosition;
javax.swing.text.JTextComponent.replaceSelection, .setText.
Supposedly repaint, revalidate and invalidate are intended to be
thread-safe.
EventListenerList claims to provide "a degree of MT safety", which is
utterly meaningless.
[1] http://java.sun.com/products/jfc/swingdoc-archive/threads.html
I suspect that section of the tutorial has been replaced since the
references to it in the RI API docs were written...
There is a key point about statics. Applets running from different web
sites should have different event threads. Therefore, statics in Swing
(and elsewhere) need to be treated with extreme caution.
http://sunsolve.sun.com/search/document.do?assetkey=1-26-102622-1
Tom Hawtin