"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
A good workman is known by his tools.
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
"I'm not back." - Bill Harding, Twister
Originally posted by Ilja Preuss:
There seem to be some basic misunderstandings on how threads work here, so I'm moving this to our Thread forum...
Nothing special happens.
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Originally posted by Marc Peabody:
I don't think b's doSomething method has visibility to t.
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Originally posted by Chris Hurst:
Apologies if this confuses more than helps ...
...doSomething in 'A' could be declared static
... it should be obvious that all doSomething's memory accesses writes are local to the stack of the thread executing i.e. A can't see B ... so no problem from that threading point of a view ... etc. etc.
Note again if doSomething used a class static that would be the equivalent of a global memory write and then thread A could see B but again you don't do this.
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Originally posted by Jim Yingst:
Chris hit the core of what I think you're asking about,
... will throw a StackOverflowError....
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Ilja Preuss:
Nicholas, I'm not sure whether I'm able to totally follow you, but it seems to me that you might still be misunderstanding something basic:
It's not the "instances" that are busy, it's the *underlying threads*.
.... there wouldn't be a "failure mode" that you seem to be imagining. The run() method simply would be executed twice, concurrently - once on a new thread, once on the main thread.
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
Originally posted by Chris Hurst:
ok ...
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Originally posted by Chris Hurst:
its possible you intended this behaviour but I suspect you don't.
Originally posted by Mr. C Lamont Gilbert:
... They are not the same thing and not related at all.....
First reading your previous comments, I suspect
will not give the answer I think you are expecting
...they are not the same thing and not related at all
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Originally posted by Marc Peabody:
I don't think b's doSomething method has visibility to t.
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Originally posted by Chris Hurst:
(...quote items addressed individually...)
... also shouldn't be a member of b of type class A ...
I think possibly I see the direction your heading (maybe, sorry if I have the wrong end of the stick)
Apologies if this confuses more than helps...
So doSomething can be thought of as just a procedure, a definition of instructions two threads are reading at the same time, each thread has its own stack neither visible to the other, you can forget all about objects in this case.
i.e. doSomething can just be the equivalent of a procedure hidden in the namespace of A a C++ compiler might name mangle it into A__doSomething (actually the non static version would have the same name but the first parameter would be the object type (the hidden this pointer but you don't use a this pointer)) ( this is the kind of thing you have to know if you do JNI
...Note again if doSomething used a class static that would be the equivalent of a global memory write and then thread A could see B but again you don't do this.
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."