Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3867

Worker Threads and EDT

From "i.dont.need" <i.dont.need@THRWHITE.remove-dii-this>
Subject Worker Threads and EDT
Message-ID <aVJkk.50144$nD.30868@pd7urf1no> (permalink)
Newsgroups comp.lang.java.gui
Date 2011-04-27 15:47 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui

I have some legacy code to spruce up, and it breaks one of the cardinal 
rules of swing: it updates the UI with worker threads (not the EDT). 
Finding all of the potential culprits is easy, but there are hundreds of 
cases which could be problematic, and the vast majority are fine. It is 
quite difficult to determine via inspection whether or not a specific 
worker thread will cause problems because dependencies back to the UI 
are typically routed through at least one interface, one or more 
abstract classes and a chain of one or more listeners (business objects 
expose a generic property change event, and all manner of things 
register for notifications). How can I figure out which threads have a 
transitive dependency back to some UI object? I could easily name worker 
threads, but the problems typically manifest themselves on the EDT in 
the various paint methods. Is there any way I could instrument the code 
so that in development, I could throw an exception any time a component 
is touched by a thread other than the EDT?

--
Shane

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Worker Threads and EDT "i.dont.need" <i.dont.need@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
  Re: Worker Threads and ED "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
    Re: Worker Threads and ED "i.dont.need" <i.dont.need@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
    Re: Worker Threads and ED "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
      Re: Worker Threads and ED "jlp" <jlp@THRWHITE.remove-dii-this> - 2011-04-27 15:48 +0000
  Re: Worker Threads and ED "Larry A Barowski" <larry.a.barowski@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
    Re: Worker Threads and ED "i.dont.need" <i.dont.need@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000
      Re: Worker Threads and ED "Larry A Barowski" <larry.a.barowski@THRWHITE.remove-dii-this> - 2011-04-27 15:47 +0000

csiph-web