classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] FYI: BoxLayout thread-safe


From: Norman Hendrich
Subject: Re: [cp-patches] FYI: BoxLayout thread-safe
Date: Tue, 25 Oct 2005 10:40:49 +0200 (CEST)

David Daney wrote:

> Isn't manipulation in multiple threads against the law in swing?
> If we do this, wouldn't it logically follow that we should make all of 
> swing reentrant/thread-safe?

Yes. No.

Note that BoxLayout is just a (very useful) LayoutManager and has no
specific reference to Swing - apart from residing in javax.swing.
I guess users might expect they can use it for their AWT applications.


> Perhaps a better approach would be to fix the calling code.

Unfortunately, many existing Swing apps are not 100% thread-safe
(e.g., in many book code examples, the gui is initalized in the
main thread, and then show() is called. Broken, but works most
of the time.)

The previous implementation exposed bugs in a few applications
that run well with the IBM and Sun JDKs.

- Norman





reply via email to

[Prev in Thread] Current Thread [Next in Thread]