Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2005

Tip: Looking for answers? Try searching our database.

method to query the number of events on event-dispatching thread

Thread view: 
antoine - 18 Jan 2005 06:00 GMT
hello,

I am trying to correct a few performance issues with my application,
which display live market data in JTables.

for each update, I use the "invokeLater" method, so create a new
Runnable, and append one event to the event-dispatching thread.

at some point, I can see in my profiler that the dispatching of event
is getting bloated and slow, most probably because of a big number of
almost simultaneous updates.

my idea would be to query the size (length) of the event-dispatching
thread, and in case it's already big (value to determine), I could
decide on advertising only part of the updates (some are more important
than others).

would you know of a method or way to achieve that ?
thanks for your help

Antoine
Andrew McDonagh - 18 Jan 2005 23:28 GMT
> hello,
>
[quoted text clipped - 17 lines]
>
> Antoine

Pretty sure there isn't a mechanism to do this, but have you thought
about inverting the responsibility of updating the GUI?

In other words, instead of creating loads of runnable objects with a new
value to be used by the gui, you could create just a few Runnable
objects every second, but instead of them containing the value to use in
the GUI, they poll your application for the latest value.  This way you
won't be saturating the EventDispatch thread.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.