Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 91150 invoked from network); 15 Dec 2007 13:34:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Dec 2007 13:34:44 -0000 Received: (qmail 46732 invoked by uid 500); 15 Dec 2007 13:34:32 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 46705 invoked by uid 500); 15 Dec 2007 13:34:32 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 46696 invoked by uid 99); 15 Dec 2007 13:34:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Dec 2007 05:34:32 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gshimansky@gmail.com designates 209.85.134.184 as permitted sender) Received: from [209.85.134.184] (HELO mu-out-0910.google.com) (209.85.134.184) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Dec 2007 13:34:09 +0000 Received: by mu-out-0910.google.com with SMTP id w8so2154319mue.4 for ; Sat, 15 Dec 2007 05:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; bh=QwLay0EgwwrvR6eebBy0OGgpGzConFpBEyEYHJJJKw0=; b=lAhgtNQFSr4y0cC6sy7fSEtIZjmChqcV1hgHly5oYpJM9Pdc1PPho5px45Kn45M0LjAGDj1g/1HLUXnpheXPMzSyNrFLVX7ePV5WpGmE8Th9NqbboHNq1Gu5MtcvV6C48qz21aW8p/pxcjmcL+lXWBf7fcC84D44wq5yIFPe9r4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id:sender; b=bfQG5XQTCWXsaP9UJ9hEtUBBoH67/op6BZ5AyP3Y0vI7ATZij9p7Iq8GWtJio7+DaHqdmAIPDRB9Ya87qrWbld/1z8UePkdaTS9eK071uGz0Oj6pOf5KE9Yn7Up3WcBpK6IC6AVVNiL2nZU92MemWHdZJhN8HfEwbtmgFkQn280= Received: by 10.78.138.6 with SMTP id l6mr2471124hud.32.1197725651504; Sat, 15 Dec 2007 05:34:11 -0800 (PST) Received: from desktop ( [91.76.77.66]) by mx.google.com with ESMTPS id y6sm24638028mug.2007.12.15.05.34.08 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 15 Dec 2007 05:34:10 -0800 (PST) From: Gregory Shimansky To: dev@harmony.apache.org Subject: Re: [drlvm][jitrino] Date: Sat, 15 Dec 2007 16:34:01 +0300 User-Agent: KMail/1.9.7 References: <200712151220.29875.gshimansky@apache.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline Message-Id: <200712151634.02086.gshimansky@apache.org> Sender: Gregory Shimansky X-Virus-Checked: Checked by ClamAV on apache.org On 15 декабря 2007 史成荣 wrote: > 2007/12/15, Gregory Shimansky : > > On 15 December 2007 史成荣 wrote: > > > I still have 2 questions. > > > > > > First, I know in the Thread Manager, it is the > > > hythread_thin_monitor_try_enter method to aquire the mutex lock > > > and implement the *memory barrier.* But* *I looked into the code of > > > this method, didn't find any memory barrier operations(including the > > > apr_memory_rw_barrier() call and cmpxchg operation) when it is the fat > > > lock. when aquiring the fat lock, it calls the > > > > hythread_monitor_try_enter > > > > > method. In the hythread_monitor_try_enter method* there isn't *memory > > > barrier operations, but has a call of the *hymutex_trylock* method. > > > Does the hymutex_trylock method also has barrier effect built-in? > > > > Fat monitors use OS synchronization primitives. You can take a look in > > vm/thread/src/{win,linux}/os_mutex.c files to see the exact > > implementation. > > I had taken a look into vm/thread/src/{win,linux}/os_mutex.c files, and > found pthread_mutex_trylock(linux) and TryEnterCriticalSection(win) > methods. Do you mean the two methods not only have mutex lock function, but > also have barrier effect? They do all (you can be sure about it) of the necessary synchronization stuff since they go into the OS kernel. In case the processor architecture needs memory barriers they do it. -- Gregory