Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #4764
| From | simplicity <stella_pigeon@live.ca> |
|---|---|
| Newsgroups | comp.lang.java.gui |
| Subject | Re: How to force the timer to start |
| Date | 2011-11-24 11:02 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <7db36a79-0a48-47f4-bb85-a4a88633c4b8@h30g2000pro.googlegroups.com> (permalink) |
| References | <3be9f413-0634-4b56-8e24-8d85dd121793@d5g2000prf.googlegroups.com> <lqisc75kicjrmeob07sgltteoqh3hu0sqb@4ax.com> |
On Nov 24, 6:51 am, Roedy Green <see_webs...@mindprod.com.invalid> wrote: > On Wed, 23 Nov 2011 18:25:43 -0800 (PST), simplicity > <stella_pig...@live.ca> wrote, quoted or indirectly quoted someone who > said : > > >I see something strange and unexpected in the behaviour of the Timer > >object. I would appreciate a hint about what is going on. > > For the usual Timer gotchas, seehttp://mindprod.com/jgloss/timer.html > > Keep in mind there are two Timer classes. The Swing timer is designed > for things that happen on the EDT thread. Of course it can't do > anything if the Swing thread is busy. You may have inadvertently put > it to sleep or overwhelmed it with work. It is a Swing timer I running in the app. > I would try commenting out the JNI code to see if the problem is on > the C side or the Java side. It looks like it is a C side which is stuck, that is, it is not getting the callback until the cursor moves. I print some debug messages in both the DLL and Java and see the following : Java: 1322160351 Timer kicks in... Number of callback messages: 0 1322160353 Timer kicks in... Number of callback messages: 0 ... 1322160379 Timer kicks in... Number of callback messages: 0 1322160381 Timer kicks in... Number of callback messages: 1 DLL: 1322160349: Connect 1322160380: onConnect(4): queue size = 1 This shows that (1) I click the button which calls native Connect() at time 349. (2) The 2 sec timer kicks in and I start getting timer events from time 351. (3) I do not move the mouse for some 48 sec, eventually move it around time 379. (4) Native callback onConnect() executes at time 380 and I get the event next time the java timer kicks in at time 381. Any idea what holds the execution of the native code in this scenario following the mouse click until the mouse is moved?
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to force the timer to start simplicity <stella_pigeon@live.ca> - 2011-11-23 18:25 -0800
Re: How to force the timer to start Roedy Green <see_website@mindprod.com.invalid> - 2011-11-24 05:51 -0800
Re: How to force the timer to start simplicity <stella_pigeon@live.ca> - 2011-11-24 11:02 -0800
Re: How to force the timer to start Roedy Green <see_website@mindprod.com.invalid> - 2011-11-24 15:42 -0800
Re: How to force the timer to start simplicity <stella_pigeon@live.ca> - 2011-11-25 15:14 -0800
Re: How to force the timer to start Roedy Green <see_website@mindprod.com.invalid> - 2011-11-26 09:59 -0800
Re: How to force the timer to start Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-11-26 15:45 -0800
Re: How to force the timer to start simplicity <stella_pigeon@live.ca> - 2011-11-29 13:25 -0800
Re: How to force the timer to start Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-11-29 15:46 -0800
Re: How to force the timer to start Nigel Wade <nmw-news@ion.le.ac.uk> - 2011-11-30 09:30 +0000
csiph-web