Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #3379
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nx02.iad01.newshosting.com!newshosting.com!69.16.185.21.MISMATCH!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!x8g2000prh.googlegroups.com!not-for-mail |
|---|---|
| From | byhesed <byhesed@gmail.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: A question about synchronized threads |
| Date | Sat, 30 Apr 2011 09:12:33 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 47 |
| Message-ID | <d47538d1-fe49-40be-96d2-cb14a56b4add@x8g2000prh.googlegroups.com> (permalink) |
| References | <3f249d87-aaf8-4732-9ee8-fd112cf82553@f31g2000pri.googlegroups.com> <ipemsm$7nc$1@news.albasani.net> <8b7289b0-2b52-44f9-96a9-fe1d2661de11@k3g2000prl.googlegroups.com> <922offF2frU1@mid.individual.net> |
| NNTP-Posting-Host | 119.202.36.92 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| X-Trace | posting.google.com 1304179954 21297 127.0.0.1 (30 Apr 2011 16:12:34 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Sat, 30 Apr 2011 16:12:34 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | x8g2000prh.googlegroups.com; posting-host=119.202.36.92; posting-account=v_GC8QoAAABz34PprEBWdejdnnHZvg4_ |
| User-Agent | G2/1.0 |
| X-HTTP-UserAgent | Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.60 Safari/534.24,gzip(gfe) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3379 |
Show key headers only | View raw
On 5월1일, 오전12시34분, Robert Klemme <shortcut...@googlemail.com> wrote: > On 29.04.2011 18:12, byhesed wrote: > > > On 4월30일, 오전12시53분, Lew<no...@lewscanon.com> wrote: > >> What do you mean by "better"? What precisely is not the way you want it? > >> What is your standard of effectuality? > > If too much spaces are marked as critical regions, > > then the program will not be optimized. > > It wastes too much time in waiting for obtaining a right to access > > critical regions. > > > So, in my question, better means optimization when using threads. > > There is no one size fits all answer to that question. It completely > depends on the nature of your application. For example, if read > accesses vastly outnumber write accesses you will get significant > improvements by using read write locks. If it is the other way round > you won't notice a big difference between using "synchronized" and a > read write lock (because most of the time the exclusive write lock will > be used). > > In other situations not sharing mutable state (i.e. copying mutable > state or using immutable state) might be the best solution. Or you use > a thread safe data structure such as copy on write list. > > There is a whole, big toolbox for writing scalable thread safe > applications. Eric has it exactly right with his suggestion because the > nature of the state (shared, not shared, mutable, immutable) is the > important aspect to reason about. I recommend reading Doug Lea's > excellent book on the matter. > > Kind regards > > robert > > -- > remember.guy do |as, often| as.you_can - without endhttp://blog.rubybestpractices.com/ Thank you, I'll read it.
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Re: A question about synchronized threads Robert Klemme <shortcutter@googlemail.com> - 2011-04-30 17:34 +0200
Re: A question about synchronized threads byhesed <byhesed@gmail.com> - 2011-04-30 09:12 -0700
Re: A question about synchronized threads Deeyana <d.awlberg@hotmail.invalid> - 2011-04-30 19:43 +0000
Re: A question about synchronized threads Lew <noone@lewscanon.com> - 2011-05-03 18:47 -0400
Re: A question about synchronized threads Deeyana <d.awlberg@hotmail.invalid> - 2011-05-04 00:12 +0000
Re: A question about synchronized threads Lew <noone@lewscanon.com> - 2011-05-03 23:35 -0400
Re: A question about synchronized threads Deeyana <d.awlberg@hotmail.invalid> - 2011-05-04 07:05 +0000
Re: A question about synchronized threads Lew <noone@lewscanon.com> - 2011-05-04 12:44 -0400
Re: A question about synchronized threads Deeyana <d.awlberg@hotmail.invalid> - 2011-05-04 19:57 +0000
csiph-web