Path: csiph.com!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: markspace Newsgroups: comp.lang.java.programmer Subject: Re: What is so bad aboud Thread.stop() ? Date: Tue, 13 Aug 2013 16:45:13 -0700 Organization: A noiseless patient Spider Lines: 22 Message-ID: References: <8fe57dc2-a323-4821-941c-4036663cbce5@googlegroups.com> <7cb96188-91ce-4c2b-ace8-5eeb1b30815e@googlegroups.com> <5f47910f-5450-4578-818c-cac2d4b6f436@googlegroups.com> <39a5e684-7cf8-4f00-ba3b-7e280b19d669@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 13 Aug 2013 23:45:17 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="5aa64ebf9a53573f97c75abba936b0e2"; logging-data="21577"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18KC9Bg0rUICafMfg38eW3zj7M+QmHOOpQ=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 In-Reply-To: Cancel-Lock: sha1:ydWDRQ5VDsLNd2go338cgjHLbyE= Xref: csiph.com comp.lang.java.programmer:24960 On 8/13/2013 4:08 PM, Arivald wrote: > And how to make sure such condition? > For example, by using specialized queues for input and output data from > thread. Queues written in a way that guarantee that it never is > inconsistent. Yes, it is possible, using java.util.concurrent.atomic it > is possible to write lock-free and thread safe queues. > > http://www.ibm.com/developerworks/library/j-jtp04186/ That's a clever idea, but I'm not sure I'd want to rely on it working in production code. How much trouble is it really to not call Thread.stop()? That's what I see as the principle argument here. I'm not really convinced of the need for Thread.stop(), so all these workarounds seem moot. If one were really desperate, ok I can see having to resort to something like this, but it seems like there has to be several bad engineering and management decisions to get there.