Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #2408

Re: Safety Of Non-Synchronized Collections

X-Received by 10.224.72.199 with SMTP id n7mr26536779qaj.5.1357177603518; Wed, 02 Jan 2013 17:46:43 -0800 (PST)
Received by 10.49.63.164 with SMTP id h4mr7413274qes.39.1357177603486; Wed, 02 Jan 2013 17:46:43 -0800 (PST)
Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!ee4no12361318qab.0!news-out.google.com!k2ni4226qap.0!nntp.google.com!ee4no12481507qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.java.help
Date Wed, 2 Jan 2013 17:46:43 -0800 (PST)
In-Reply-To <kc26uq$u73$1@dont-email.me>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
NNTP-Posting-Host 69.28.149.29
References <kbvhvc$le1$1@dont-email.me> <kbvubp$4mr$1@dont-email.me> <6fa66d26-85c8-46df-97f3-37d8fff69222@googlegroups.com> <kc26uq$u73$1@dont-email.me>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <1cab1d63-1f5d-4b3e-89d9-a8e95ed883bb@googlegroups.com> (permalink)
Subject Re: Safety Of Non-Synchronized Collections
From Lew <lewbloch@gmail.com>
Injection-Date Thu, 03 Jan 2013 01:46:43 +0000
Content-Type text/plain; charset=ISO-8859-1
X-Received-Bytes 2819
Xref csiph.com comp.lang.java.help:2408

Show key headers only | View raw


markspace wrote:
> Lew wrote:
>> But you don't have to understand absolutely everything about
>> concurrent programming to get that much right. Nor do you have to be
>> a master of concurrent programming, not that that's really possible,
>> to do any.
> 
> Not understand everything, no.  But I do think you have master the basic 
> Java language specification in order to be able to reason about when 

Did I not say essentially that?

> your code is safe, and when it's not, for coding in Java.  I hardly know 
> everything about concurrency, but I can usually write thread-safe code. 

Did I not say that was the pattern?

"But you don't have to understand absolutely everything about concurrent programming ..."

>   It's pretty easy once you understand how.

"The /happens-before/ relationship definitely helps one to reason 
correctly about [concurrency]."

> But I do restrict myself to a subset of Java and concurrency.  Reasoning 
> 
> from first principles is hard.  I try to avoid it.  Using basic patterns 
> 
> like immutability, safe publication, ad-hoc thread confinement and the 

From my post: "Yes, you do have to understand what immutable means."

> java.lang.concurrent package will get you a long ways in any concurrency 
> project.

"Even with knowledge, it's just so much easier to rely on immutability."

> But if you haven't at least tried to reason those patterns out and 
> understand them in terms of the basic language specification, I don't 
> think you could use them successfully.  Not 100% of the time; and 
> probably no more than 50%.

We vehemently agree.

-- 
Lew

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Safety Of Non-Synchronized Collections Steve <tinker123@gmail.com> - 2013-01-01 15:46 -0500
  Re: Safety Of Non-Synchronized Collections Knute Johnson <nospam@knutejohnson.com> - 2013-01-01 14:18 -0800
    Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-01 15:43 -0800
  Re: Safety Of Non-Synchronized Collections markspace <markspace@nospam.nospam> - 2013-01-01 16:17 -0800
    Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-02 11:12 -0800
      Re: Safety Of Non-Synchronized Collections markspace <markspace@nospam.nospam> - 2013-01-02 12:56 -0800
        Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-02 17:46 -0800
  Re: Safety Of Non-Synchronized Collections Roedy Green <see_website@mindprod.com.invalid> - 2013-01-03 05:59 -0800
    Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-03 15:30 -0800
      Re: Safety Of Non-Synchronized Collections Roedy Green <see_website@mindprod.com.invalid> - 2013-01-09 12:17 -0800
        Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-09 12:56 -0800
          Re: Safety Of Non-Synchronized Collections Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-01-09 13:10 -0800
            Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-09 14:51 -0800
              Re: Safety Of Non-Synchronized Collections Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-01-09 15:22 -0800
                Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-09 16:26 -0800
                Re: Safety Of Non-Synchronized Collections Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-01-09 16:42 -0800
                Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-09 16:54 -0800
                Re: Safety Of Non-Synchronized Collections Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-01-10 10:30 -0800
                Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-10 10:58 -0800
                Re: Safety Of Non-Synchronized Collections markspace <markspace@nospam.nospam> - 2013-01-09 16:50 -0800
                Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-09 16:59 -0800
                Re: Safety Of Non-Synchronized Collections markspace <markspace@nospam.nospam> - 2013-01-10 08:18 -0800
                Re: Safety Of Non-Synchronized Collections Lew <lewbloch@gmail.com> - 2013-01-10 10:49 -0800
                Re: Safety Of Non-Synchronized Collections Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2013-01-10 13:37 +0200
                Re: Safety Of Non-Synchronized Collections Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-01-10 09:27 -0500
                Re: Safety Of Non-Synchronized Collections Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2013-01-10 17:14 +0200
                Re: Safety Of Non-Synchronized Collections Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-01-10 11:44 -0500
                Re: Safety Of Non-Synchronized Collections Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2013-01-10 23:41 +0200
                Re: Safety Of Non-Synchronized Collections Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-01-10 17:14 -0500
                Re: Safety Of Non-Synchronized Collections Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2013-01-11 09:10 +0200
                Re: Safety Of Non-Synchronized Collections Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-01-11 08:25 -0500

csiph-web