Article View: borland.public.jbuilder.java.swing
Article #10115Re: Swing, Threads, and Progress meters.
From: John P. McGrath
Date: Tue, 09 Nov 1999 00:00
Date: Tue, 09 Nov 1999 00:00
27 lines
1905 bytes
1905 bytes
On Mon, 08 Nov 1999 09:50:19 +0000, Steve Horsley wrote: > I have never bothered to check if I am on the event thread > before using invokeLater. In everything I have written > invokeLater in, it has always been pretty obvious that I > will not be on the event thread anyway. In the example > above, the counter changes were always caused by the > transmit timer thread (transmit packet count) or the > socket listener thread (rx packet count). I think that > performing this check is more likely to waste time than > save it. In my case, most of the events will occur entirely on the event thread, in direct response to the user dragging things around the screen, resizing objects, etc. This is where the response is the most critical. In the few threaded operations, the immediate response is less critical, since it will be part of a rather lengthy operation. So the test will eliminate operations when they count, and only cost more when it does not. My guess is that it will help in this case, although I doubt that it will be clearly perceivable. But it will just be a single line of code, so I think I will try it. -- John P. McGrath <mcgrath@enter.net> <jpm@nscs.fast.net>
Technical Details
Message-ID:
<MPG.1291cae746b2028798969f@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<MPG.1289bc46f1d0f7aa989685@forums.borland.com> <38212c72.1261133@forums.inprise.com> <MPG.128afecc7d95098098968d@forums.borland.com> <3821581E.88C37E4C@cwcom.co.uk> <MPG.128da709fed5afdb989696@forums.borland.com> <38269CDB.FD101A64@cwcom.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,eebaae9990e98781 X-Google-Attributes: gid111d45,public From: John P. McGrath <mcgrath@enter.net> Subject: Re: Swing, Threads, and Progress meters. Date: 1999/11/09 Message-ID: <MPG.1291cae746b2028798969f@forums.borland.com> X-Deja-AN: 546393025 References: <MPG.1289bc46f1d0f7aa989685@forums.borland.com> <38212c72.1261133@forums.inprise.com> <MPG.128afecc7d95098098968d@forums.borland.com> <3821581E.88C37E4C@cwcom.co.uk> <MPG.128da709fed5afdb989696@forums.borland.com> <38269CDB.FD101A64@cwcom.co.uk> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing