Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #3355
| 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 | Fri, 29 Apr 2011 11:53:25 -0400 |
| Organization | albasani.net |
| Lines | 30 |
| Message-ID | <ipemsm$7nc$1@news.albasani.net> (permalink) |
| References | <3f249d87-aaf8-4732-9ee8-fd112cf82553@f31g2000pri.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net eH/G7pvpn9fk2djeD20jkvO09c9+dIgFCLNTqtMmpC8vEWbyAMdv2gGx3CKFq9B67LW7ZCzTD2HAbDFu/Jz/SQ== |
| NNTP-Posting-Date | Fri, 29 Apr 2011 15:52:54 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="PUd3k37Gr+w6pxSviujoYb2HLt9C42M3F5tx3zZk8noxgiKXS1Dz4vW3Qh5LbsR+j4WJDLXEjVjf7CBZvOrDal0k/FVsV6dDxXJd2IiIC26p4JDWusZXqdOOwkHTGrDF"; 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 | <3f249d87-aaf8-4732-9ee8-fd112cf82553@f31g2000pri.googlegroups.com> |
| Cancel-Lock | sha1:+GLkZLFPr702W58FN5XhLVigfFM= |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:3355 |
Show key headers only | View raw
On 04/29/2011 11:35 AM, byhesed wrote:
> public class A {
> synchronized void m1() { ... }
> synchronized void m2() { ... }
> void m3() { ... }
> }
>
> The book explains above code:
>
> Given an instance a of class A, when one thread is executing
> a.m1(),
> another thread will be prohibited from executing a.m1() or a.m2().
>
> I have a question.
>
> The explanation means than when one thread is executing m1() method,
> No other threads can execute m1() or m2() thread.
For that particular instance, yes.
> Is it correct? If it is correct, how can I handle it better?
> I think it is too ineffectual. Does anybody know?
What do you mean by "better"? What precisely is not the way you want it?
What is your standard of effectuality?
--
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