Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #3499
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail |
|---|---|
| From | Lew <noone@lewscanon.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: A question about synchronized threads |
| Date | Wed, 04 May 2011 12:45:51 -0400 |
| Organization | albasani.net |
| Lines | 32 |
| Message-ID | <iprvpo$c9g$2@news.albasani.net> (permalink) |
| References | <3f249d87-aaf8-4732-9ee8-fd112cf82553@f31g2000pri.googlegroups.com> <68sr88-fuj.ln1@dagon.net> <0f043640-9fb3-430f-bcf6-d830a2dd6e81@k15g2000pri.googlegroups.com> <ipq16g$t0s$1@news.albasani.net> <ipq5u1$de6$2@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net uCD7T0ple29MIhaYiNmPhRXdqiebmlqlMQ7mPXvuFt3yHbH0hhKHPQ1TUpomdh4+pGj5HrI2jZyE2qEp2X4+fA== |
| NNTP-Posting-Date | Wed, 4 May 2011 16:44:41 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="gGtblomRnAWP/PdEf2+6PUtojSFKeqvyWQiG1zKjtyfh9/3gMtGJjPTuaQn/KM/qt4U7TjT0O30Dn1wbBEho4mkC0bkGX/z3fqkOL5v2oOBqLndqqo4zn26vg/ZeaEwh"; mail-complaints-to="abuse@albasani.net" |
| User-Agent | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 |
| In-Reply-To | <ipq5u1$de6$2@dont-email.me> |
| Cancel-Lock | sha1:rNZND/xrguJbAnyA7QpUZ0NqR7M= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3499 |
Show key headers only | View raw
On 05/03/2011 08:17 PM, Deeyana wrote: > On Tue, 03 May 2011 18:57:19 -0400, Lew wrote: > >> byhesed wrote: >>> I thought that synchronizing entire methods would be wasteful. >> >> Why? > > It is well known that shorter critical sections and finer lock > granularity can increase concurrency, Lew. > >> Also, if two methods are "totally unrelated to each other" then you >> don't need any synchronization at all. > > Classic unsubstantiated and erroneous claim. They may still need > synchronization to prevent the simultaneous use of a) the SAME one by two > different threads on the same object or b) one of them and some third > method on the same object. But you may want an explicit lock object > instead of the default effects of declaring the methods synchronized. > >> The single best, most effective way to optimize concurrent code is not >> to share data. The second-best way is to make shared-data immutable >> (read-only). > > Clojure can help a lot with the latter. Plonk, schmuck. -- Lew Honi soit qui mal y pense. http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
A question about synchronized threads byhesed <byhesed@gmail.com> - 2011-04-29 08:35 -0700
Re: A question about synchronized threads Lew <noone@lewscanon.com> - 2011-04-29 11:53 -0400
Re: A question about synchronized threads byhesed <byhesed@gmail.com> - 2011-04-29 09:12 -0700
Re: A question about synchronized threads Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-04-29 21:01 -0400
Re: A question about synchronized threads byhesed <byhesed@gmail.com> - 2011-04-29 18:43 -0700
Re: A question about synchronized threads Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-29 17:58 +0200
Re: A question about synchronized threads byhesed <byhesed@gmail.com> - 2011-04-29 09:09 -0700
Re: A question about synchronized threads markspace <-@.> - 2011-04-29 11:11 -0700
Re: A question about synchronized threads Daniele Futtorovic <da.futt.news@laposte-dot-net.invalid> - 2011-04-29 20:19 +0200
Re: A question about synchronized threads markspace <-@.> - 2011-04-29 15:21 -0700
Re: A question about synchronized threads Patricia Shanahan <pats@acm.org> - 2011-04-29 21:10 -0700
Re: A question about synchronized threads dagon@dagon.net (Dagon) - 2011-04-29 15:55 -0700
Re: A question about synchronized threads Alice <quaxx1108@example.com> - 2011-04-29 20:08 -0400
Re: A question about synchronized threads markspace <-@.> - 2011-04-29 19:07 -0700
Re: A question about synchronized threads byhesed <byhesed@gmail.com> - 2011-04-29 18:49 -0700
Re: A question about synchronized threads Lew <noone@lewscanon.com> - 2011-05-03 18:57 -0400
Re: A question about synchronized threads Deeyana <d.awlberg@hotmail.invalid> - 2011-05-04 00:17 +0000
Re: A question about synchronized threads Lew <noone@lewscanon.com> - 2011-05-04 12:45 -0400
Re: A question about synchronized threads Deeyana <d.awlberg@hotmail.invalid> - 2011-05-04 19:59 +0000
csiph-web