Path: csiph.com!usenet.pasdenom.info!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: blmblm@myrealbox.com Newsgroups: comp.lang.java.programmer Subject: Re: What is so bad aboud Thread.stop() ? Date: 14 Aug 2013 22:42:44 GMT Organization: None Lines: 31 Message-ID: References: <8fe57dc2-a323-4821-941c-4036663cbce5@googlegroups.com> <7cb96188-91ce-4c2b-ace8-5eeb1b30815e@googlegroups.com> X-Trace: individual.net Ub5iZJuj63PJfXWDWmpvfQFvDH5HMAlElMHqAnbD4sBrXcuI/S X-Orig-Path: not-for-mail Cancel-Lock: sha1:ANS6LnGBk5wqsHBSUUooJdkqsjo= X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Xref: csiph.com comp.lang.java.programmer:24980 In article , Patricia Shanahan wrote: > On 8/13/2013 1:18 PM, blmblm@myrealbox.com wrote: > ... > > But to get back to your presumably-safe scenario, in which thread B > > finishes normally. It seems reasonable to assume that all values > > assigned in thread B should then be visible to other threads. > > What I'm wondering, though, is whether that's explicitly required > > by the Java memory model. (Yeah, yeah, really I should probably > > just go read up on the memory model myself, but I thought someone > > else might know, and that this might be an interesting point to > > raise anyway.) > ... > > "The final action in a thread T1 synchronizes-with any action in another > thread T2 that detects that T1 has terminated. T2 may accomplish this by > calling T1.isAlive() or T1.join()." > > http://docs.oracle.com/javase/specs/jls/se5.0/html/memory.html#17.4.4 > Thanks. That seems fairly straightforward -- and I understand it to mean "yes, the memory model does require that all values be visible, assuming the thread doing the stop-another-thread then does a join() to ensure that the stopped thread has finished". -- B. L. Massingill ObDisclaimer: I don't speak for my employers; they return the favor.