> Well, the application is a fast, near real-time Online Futures
Please do not top-post. Use trim-and-inline posting.
> Scalping application, so it acquires market data, up to about 10,000
> events per minute, analyzes, charts and also manages multiple
[quoted text clipped - 8 lines]
> execution of Swing events but, for now, I believe these events execute
> on the GUI dispatch thread.
The Swing events run on the EDT, and must.
> Let's say I want a keystroke or a mouse click to affect order
> processing activity. My simple understanding is that these run on the
> GUI dispatch thread, which is a reasonable design decision designed to
> serialize their activity.
It is necessary by the very innate nature of GUIs.
> So, I want to elevate/control the execution priority of the GUI
> thread, so that these events, which ultimately kick off order entry
> actions, are themselves very responsive.
No, you want to make sure the order entry actions happen at a high priority,
not the GUI events. In fact, you likely do not need to mess with the
priorities at all.
> I understand the concerns associated with multiple thread priorities,
> and I think I've struck a reasonable balance here.
I am not sure that you do, nor that you have.
What other threads are running whose priority you wish to preempt in favor of
the GUI?
> I don't actually have long-running activities on the GUI thread, so
> that's not a concern.
"Long-running" is a relative term. In your case I suspect you'll get more
benefit from updating your model on a non-EDT (possibly high-priority) thread
than by changing the EDT priority.
> But specifically, this was my reason for wanting to have some control
> over the priority of GUI activities. The idea being that a keystroke
> or mouse click should run in preference to my lower-priority NON-order
> processing threads, because most of these GUI activities are designed
What are these other threads? Do they influence the GUI?
> to be responsive in a chain of my highest priority events, which are
> live order processing management.
So run the model that changes prices at a higher priority. Your GUI happens
for all logic, not just the priority logic, all in the EDT - one thread for
GUI service to all other non-GUI threads.
You should make the high-priority /logic/ higher priority, not the GUI.
> I should add here that I stress the Java Server VM to its limits in
> this application, and things are very fast, for a Java application,
[quoted text clipped - 24 lines]
> Dswing.metalTheme=steel
> -Duser.timezone=America/New_York -Duser.language=en -Duser.region=US"/
I just don't think it's the EDT priority that should concern you. Of course I
don't really know, but do not be surprised if playing with the EDT priority
fails to help very much. If your model updates fast enough you might find
that the GUI can keep up without having to mess with priority.
In other words, be sure to test your assumptions before deploying them into
production.
For one thing, if you boost the EDT priority, it boosts for *all* GUI events,
not just the ones associated with your price changes. Instead, boost the
priority of the threads that actually handle the order price changes.
If you really want faster, switch from Vista to Linux or Solaris. Consider
multi-processor servers. With all those threads you have you should be able
to make good use of such a platform.

Signature
Lew
FutureScalper - 14 Jan 2008 03:50 GMT
OK, thanks for the help.
I run a Quad Q6600 with 3+ mb usable RAM and Vista has an excellent
scheduler, so I don't need linux, etc. as you suggest.
You appear to be of the persuasion that one should not manipulate
thread priority. I don't think that's realistic in a near real-time
or "soft" realtime high performance application such as mine.
Anyway, thanks. I don't want to discuss it further.
Lew - 14 Jan 2008 04:23 GMT
> I run a Quad Q6600 with 3+ mb usable RAM and Vista has an excellent
> scheduler, so I don't need linux [sic], etc. as you suggest.
>
> You appear to be of the persuasion that one should not manipulate
> thread priority.
Well, that's a thorough misinterpretation of what I said. I wonder how you
arrived at that conclusion.
What I actually said was that I thought that manipulating the EDT priority
specifically would not be helpful. Didn't you catch the part where I
suggested altering the priority of the worker threads instead?
> I don't think that's realistic in a near real-time or "soft" realtime high performance application such as mine.
No disagreement here.
> Anyway, thanks. I don't want to discuss it further.
How about if you let us know the results of your research at least? Now that
you've gotten us involved it would be the nice thing to do.

Signature
Lew
Arne Vajhøj - 16 Jan 2008 03:29 GMT
> I run a Quad Q6600 with 3+ mb usable RAM
That was not much RAM ...
:-)
Arne