harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <g...@pobox.com>
Subject Re: [-SPAM-] RE: [-SPAM-] RE: [classlib][swing] an odd code in swing
Date Fri, 08 Dec 2006 17:18:36 GMT


Thomas Hawtin wrote:
> Ivanov, Alexey A wrote:
>>> From: Nathan Beyer [mailto:nbeyer@gmail.com]
>>> 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.

It's like "a degree of pregnancy..."

> 
>> [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

Mime
View raw message