Problem with Java EventQueues

P

Paul Thomas

Hi all,

I am having trouble with Java EventQueues. I am working on a software
that does some transactions. I have a swing based GUI. Some of the
elements in the GUI (drop down boxes and buttons) have listeners.

This is the problem that I am having. After each transaction ( which
involves pulling down a drop down menu and clicking a button) two
AWT-EventQueue Threads are being created. These threads are not
exiting. I analyzed to program using Borland OptimizeIt. Two threads
are getting created per transaction (as expected). They are active
during the duration of a transaction. But after the transaction ends
these threads are not exiting. ( But they are idle). So after 20
transaction I am left with 40 unwanted idle threads.

Anybody got any clue what is going on.

If you could mail me back any suggestions to (e-mail address removed) I
would really appreciate it.

Thank you very much for your time,
Paul Thomas
 
F

Frank

Hi all,

I am having trouble with Java EventQueues. I am working on a software
that does some transactions. I have a swing based GUI. Some of the
elements in the GUI (drop down boxes and buttons) have listeners.

This is the problem that I am having. After each transaction ( which
involves pulling down a drop down menu and clicking a button) two
AWT-EventQueue Threads are being created. These threads are not
exiting. I analyzed to program using Borland OptimizeIt. Two threads
are getting created per transaction (as expected). They are active
during the duration of a transaction. But after the transaction ends
these threads are not exiting. ( But they are idle). So after 20
transaction I am left with 40 unwanted idle threads.

Anybody got any clue what is going on.

If you could mail me back any suggestions to (e-mail address removed) I
would really appreciate it.

Thank you very much for your time,
Paul Thomas

EventQueue threads don't exit... there's always the possibility that
another event could be posted to their queue, and they'ld have to process
it.

Why are you creating your own event queues though? As opposed to just
posting events to the system queue and let the system EDT take care of it,
or spawning your own temporary threads? Or at a bare minimum, caching your
queues so you're not recreating them...

Hope this helps,

Frank
 
P

Paul Thomas

I am working on an old code. I am not sure why the original autor
wanted to put custom event queues.

Frank: are you sure that EventQueue threads dont exist. Because I am
printing out the logs. In the logs the first entry is time, the second
entry is the thread name. Here are a few typical entries

Oct 9, 2003 8:36:13 PM AWT-EventQueue-4 from mouseClicked(MouseEvent
e)
Oct 9, 2003 8:36:19 PM AWT-EventQueue-4 CustomerSession: getCost =
24.99
Oct 9, 2003 8:36:19 PM AWT-EventQueue-4 CustomerSession: getReturns
=1.75

.... At some other part of the log I have entries like this...


Oct 9, 2003 8:36:13 PM AWT-EventQueue-6 from mouseClicked(MouseEvent
e)
Oct 9, 2003 8:36:19 PM AWT-EventQueue-6 CustomerSession: getCost =
35.78
Oct 9, 2003 8:36:19 PM AWT-EventQueue-6 CustomerSession: getReturns
=2.45

From here it looks like there are threads with the name
AWT-EventQueue-*. Are these real threads or quasi threads ?????
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top