Re: File browser
- From: "Peter Duniho" <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Wed, 06 Feb 2008 10:59:21 -0800
On Wed, 06 Feb 2008 09:24:42 -0800, Nigel Wade <nmw@xxxxxxxxxxxx> wrote:
[...]I can easily write code that will consistently produce wrong results with
incorrect synchronization. It's true that one can get lucky and have it
work without. But it's also true that it's relatively simple to force a
problem in order to demonstrate the risk of failing to synchronize.
Yes, but to do that you need to be in control of the competing threads. With the EDT you are not.
Sure, you are. Any time you get your code to be called on the EDT, you are now in control. Until your code returns, you remain in control.
So it should be simple enough to write code that intentionally causes something to be called on the EDT, at which point one can take advantage of that control to ensure a synchronization error.
One of the previously-cited articles does in fact do something like this. Unfortunately, because it's specifically using invokeLater() to get code to execute on the EDT, it's not a demonstration of the problem I'm asking about. It does reliably demonstrate the potential for a problem that could occur when your own code intentially puts something for execution on the EDT, but it doesn't help me better understand how someone could unintentionally have something execute on the EDT prior to any components being visible.
[...]
The EDT is event driven, events which are affected by user actions and the
exact timing of those actions, plus other factors external to your application
which are handled by the OS.
Before any components are shown, user actions won't affect when things are executed on the EDT. So, what of those "factors external to your application"? What factors exist during initialization, prior to any components being shown, that might cause something to happen on the EDT?
I should reiterate that none of my questions are intended to suggest that the advice given is wrong. They are only intended to solicit more information that would help me understand better what the specific risks are.
Remember: "I don't know" is an acceptable answer. I just don't appreciate the attitude conveyed to me that _I_ don't need to know.
Thanks,
Pete
.
- Follow-Ups:
- Re: File browser
- From: Nigel Wade
- Re: File browser
- From: Lew
- Re: File browser
- From: fchang
- Re: File browser
- References:
- File browser
- From: Flick
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: John W. Kennedy
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Lew
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Daniel Pitts
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Daniel Pitts
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Daniel Pitts
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Daniel Pitts
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Daniele Futtorovic
- Re: File browser
- From: Lew
- Re: File browser
- From: Daniele Futtorovic
- Re: File browser
- From: Lew
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Lew
- Re: File browser
- From: Peter Duniho
- Re: File browser
- From: Nigel Wade
- File browser
- Prev by Date: Re: Data structures in java
- Next by Date: Re: Functional issues of cyclic dependencies
- Previous by thread: Re: File browser
- Next by thread: Re: File browser
- Index(es):
Relevant Pages
|