Hi Kees and others,
> When I took a look at
>
http://java.sun.com/docs/books/tutorial/essential/threads/priority.html
> my conclusion was that you don't want to set thread to a lower
> priority in a server environment. My understanding is also that
> priority is handled differently on different JVM's/Os'se.
Did you test your conclusion?
On the OS'ses i use (Linux and Windows) removing the kicker-code from
the run() method below makes the website useless when a large XML file
is imported. Whereas setting the Priority to Thread.MIN_PRIORITY+1
leaves the performance at an acceptable level during imports.
> I hope I was
> right since in the last year I have removed quite a lot to code that
> had to do with priority.
I'm afraid you might be wrong. Did you also remove the
kicker.setPriority(Thread.MIN_PRIORITY+1) from the
EmailBackgroundHandler.java between 1.7.0 and 1.7.1 ? This means that
the background email no longer runs in a thread with low priority in
1.7.1. I will have to warn the editors that the next email newsleter
will make the website unavailable ...
I thought that 1.7.1 is a bugfixing release. Removing
Thread.MIN_PRIORITY+1 code between 1.7.0 and 1.7.1 doesn't sound like
bugfixing to me.
Kind regards, Henk.
----
public void run () {
Thread kicker = Thread.currentThread();
if(kicker.getName().indexOf("XMLReaderThread")==-1) {
kicker.setName("XMLReaderThread / " + (new Date()));
kicker.setPriority(Thread.MIN_PRIORITY+1);
}
log.info("run(): " + kicker);
readXML();
}