Path: csiph.com!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: synchronized methods "under the hood" Date: Wed, 06 Mar 2013 15:24:03 +0100 Organization: albasani.net Lines: 12 Message-ID: References: <7d23ce84-c209-43a2-bf88-2d112ce21a2e@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net li4jQVIWNsUeuGbOD4iPJUAdDAI4IwORFd/ZXewZf8qieXLKxmkDDYM5R8FfHjxD4T/txYKRff3qc4apeKH9FQ== NNTP-Posting-Date: Wed, 6 Mar 2013 14:24:03 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="Io6K2FNVwG9ffm/xk75mRXm9kbHOTEueitckWITTAnRZrORpVa6UoWont18QQDj/h7+xy6qlS29MvcVSuobLuTWLIC8blstjGVTD7ZkPFtZ0qXYi77X0xqMzjwTjzqqj"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0 SeaMonkey/2.16 In-Reply-To: Cancel-Lock: sha1:KIOpIVP2m/7os6Kq+vvOK+0YPY8= Xref: csiph.com comp.lang.java.programmer:22737 Jan Burse schrieb: > - In execution the invocation and return instruction is combined > with a monitor enter and monitor exit. > > http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-2.html#jvms-2.11.10 Not sure whether also some code analysis is done, and for private self calls of synchronized methods from within synchronized methods, the monitor enter and monitor exit is eliminated. Bye