Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Threads and statics Date: Sat, 09 Apr 2011 14:57:44 -0400 Organization: A noiseless patient Spider Lines: 20 Message-ID: References: <905p9gFpuoU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 9 Apr 2011 18:57:45 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="KiwfXDyOjqGhZBXcfNnZBg"; logging-data="3687"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cNiPPDIsKaWb1cnX+0N/t" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Thunderbird/3.1.9 In-Reply-To: Cancel-Lock: sha1:Yejegd5nyNC/zYpYu2Ap5l79Oqc= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3015 On 4/9/2011 12:08 PM, Stefan Ram wrote: > Eric Sosman writes: >> manipulates). Make sure the data is always seen in a consistent >> state, except perhaps by the *one* thread that's in the act of >> changing it; then you'll have a correct program. > > It still could have potential deadlocks. [...] I also wrote, in the part you snipped >> (It might not be >> the fastest possible program -- that's where the hard parts come >> in -- but at least it won't have race conditions.) Deadlock is merely a performance problem. A really, Really, REALLY bad performance problem. ;) -- Eric Sosman esosman@ieee-dot-org.invalid