1 of 1 people found this helpful
update: what we implemented as a quick workaround:
- set priority of current thread to minimum
- perform heavy work
- set priority of current thread back to normal (in a finally block)
works pretty much as expected - but feels like a quick and dirty hack...
any better suggestions?
it seems like not too many people are having issues with threads ;-)
Anyhow, should someone be confronted with a similiar situation, here's my conclusion:
- the described way works pretty good and stable, even under production load (internal application, max 10 parallel users)
- re-adjusting the priority after "heavy work" is finished is certainly good style, but probably not required, as the default keep-alive time of a thread (see default configuration below) is one minute. So my doubt that all threads will be downgraded after a while is false - no thread will be kept alive and idle longer than one minute...
<attribute name="Name">JBoss System Threads</attribute>
<attribute name="ThreadGroupName">System Threads</attribute>
- in case that finer adjustments are required: the jmx console allows to dump all current threads, this should give a good overview of what's going on at the moment.
Hope it helps others :-)