ven jovovich wrote:It makes me wonder if it's worth learning java, static methods in interfaces !!! ?? C'mon....
maybe java will be something different with release 12 or 13, they just might drop curly braces as well (python style).
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
it's one of the things that I like (AND that I've had reason to want)
And where do you think Python got it from?
ven jovovich wrote:they just might drop
curly braces as well (python style).
ven jovovich wrote:Please tell me whether I am getting this correctly:
Supposing that the condition of "line 0" is always true, thread "t" will be interrupted at "line 1".
Now, we are doing "t.join()" on "line 2" so that the exception ALWAYS gets handled (caught)
and "I wasn't done!" always gets printed before "Finally!", right? If we commented out "line 2"
then "Finally!" might have been printed before "I wasn't done!" in some cases.
Other than this there is no point in joining a thread that has been interrupted.
Steve
In fact, just interrupting a Thread doesn't ensure it will end soon. The Thread has to respond to the interrupt, and even so it may take significant amount of time to clean up after itself.
ven jovovich wrote:So even though my thread (main thread) interrupts another thread, there is no guarantee that the execution of the other thread will stop?
Steve
ven jovovich wrote:Thanks a ton, that explains this:...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:The fact is that, like reflection (and a few other things) that Java allows, it needs to be approached with caution. Unless you work in a very specialized environment, the amount of time you spend writing multi-threaded programs is likely to be pretty low.
Jeff Verdegan wrote:However, it seems to imply that, A) Since it's not a large fraction of our total development effort, that implies it's not used in many applications, and B) Since it's not a large fraction of our development effort, it's not something we need to spend a lot of time understanding. I disagree strongly with both of those implications.
I'm pretty sure you didn't actually mean either of the implications I read into what you said, but I thought someone might take it that way, and as a "threading nut", I had to put my two cents in.
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Winston Gutkowski wrote:
I think you know me well enough to know that I'd never say that anyone shouldn't learn new techniques
my advice was more on the lines of "understand before you use" and "know when (and, probably more importantly, when not) to use".
Pay attention! Tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|