Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 89613 invoked from network); 12 Dec 2006 17:50:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2006 17:50:16 -0000 Received: (qmail 30551 invoked by uid 500); 12 Dec 2006 17:50:21 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 30524 invoked by uid 500); 12 Dec 2006 17:50:20 -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 30511 invoked by uid 99); 12 Dec 2006 17:50:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Dec 2006 09:50:20 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of weldonwjw@gmail.com designates 66.249.92.172 as permitted sender) Received: from [66.249.92.172] (HELO ug-out-1314.google.com) (66.249.92.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Dec 2006 09:50:10 -0800 Received: by ug-out-1314.google.com with SMTP id z36so1690591uge for ; Tue, 12 Dec 2006 09:49:49 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=J/qRR120F7fazLGOzMwBEvDHx4Z0MOmLD3lSsqH5y1cgrLMlyR5kPqB5FxbQ0VsqWAkdgjXkux9w8hiGN7asjv+WjJ3m8g1pVybHvLNEta8vodzxs16Pe3PeE4CtL5cNq1xIs/Xe6mTCXNtUF0BdllWEU/lvbwlPoFcN2pmlo2I= Received: by 10.78.180.18 with SMTP id c18mr841989huf.1165945788672; Tue, 12 Dec 2006 09:49:48 -0800 (PST) Received: by 10.78.136.5 with HTTP; Tue, 12 Dec 2006 09:49:48 -0800 (PST) Message-ID: <4dd1f3f00612120949m628ce9c3xdcaf578c589f1b45@mail.gmail.com> Date: Tue, 12 Dec 2006 09:49:48 -0800 From: "Weldon Washburn" To: dev@harmony.apache.org Subject: [drlvm][threading] -- some questions on thread_native_suspend.c::hythread_resume() MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_130933_20040559.1165945788629" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_130933_20040559.1165945788629 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline - A question on hythread_resume() - Line 318: " if (thread->safepoint_callback && thread->suspend_request < 2) return" - is there ever the situation where "thread->suspend_request == 0 " ?? - - is there a race condition in the use of "thread->suspend_request" in lines 318, 319, 320? - In specific, does it make sense to replace these lines of code with something like: int current_suspend_request_count; while (1) { current_suspend_request_count = thread->suspend_request; if (thread->safepoint_callback && current_suspend_request_count < 2) return; int status = apr_atomic_casptr (current_suspend_request_count, current_suspend_request--, ((apr_uint32_t *)&(thread->suspend_request); if(/*original thread->suspend_request*/ status == 1) { /* thus the new value has to be zero // Notify the thread that it may wake up now hysem_post(thread->resume_event); TRACE(("TM: resume one thread: %p request count: %d",thread , thread->suspend_request)); thread->state &= ~TM_THREAD_STATE_SUSPENDED; break; -- Weldon Washburn Intel Enterprise Solutions Software Division ------=_Part_130933_20040559.1165945788629--