A
Antti S. Brax
I am using a 3rd party library which executes an operation
that at worst may take hours to finish (an XSL transformation).
It processes large XML documents and creates thousands of
files. This library is called from a thread, which has a
"requestStop" method with which it can be stopped cleanly.
Unfortunately, the library never checks whether or not the
thread that runs it has been interrupted.
So, even though my code is correct and it stops right after
the library call finishes, I'm still stuck with a thread that
is practically impossible to stop cleanly.
Therefore, my conclusion is that if you do not periodically
check Thread.interrupted() during time consuming operations
you do not write well behaving code and you are not a good
programmer (I'd put a smiley here if I didn't have to deal
with this problem right now).
that at worst may take hours to finish (an XSL transformation).
It processes large XML documents and creates thousands of
files. This library is called from a thread, which has a
"requestStop" method with which it can be stopped cleanly.
Unfortunately, the library never checks whether or not the
thread that runs it has been interrupted.
So, even though my code is correct and it stops right after
the library call finishes, I'm still stuck with a thread that
is practically impossible to stop cleanly.
Therefore, my conclusion is that if you do not periodically
check Thread.interrupted() during time consuming operations
you do not write well behaving code and you are not a good
programmer (I'd put a smiley here if I didn't have to deal
with this problem right now).