Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 54730 invoked from network); 14 Jan 2007 21:49:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jan 2007 21:49:52 -0000 Received: (qmail 82494 invoked by uid 500); 14 Jan 2007 21:49:58 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 82450 invoked by uid 500); 14 Jan 2007 21:49:58 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 82439 invoked by uid 99); 14 Jan 2007 21:49:58 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jan 2007 13:49:58 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of rooneg@gmail.com designates 66.249.92.168 as permitted sender) Received: from [66.249.92.168] (HELO ug-out-1314.google.com) (66.249.92.168) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 14 Jan 2007 13:49:49 -0800 Received: by ug-out-1314.google.com with SMTP id 44so1198441uga for ; Sun, 14 Jan 2007 13:49:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=HrVqPwJBrFIZA70F0CORVcwwE8YU6CfzOyYlzqNAfVh2v+eVSKDjc1rELKKGXscS5hwUvCkGYXiyPZN85Bot7jxcpdLM8s6ADB7x0kq3gfP9R+xYHF6xtL8zDEjZlKGONbWh0ATDFdfarrtTkCCwgdTihkY+soSmQ6VO1bwWFt0= Received: by 10.78.146.11 with SMTP id t11mr1141019hud.1168811364941; Sun, 14 Jan 2007 13:49:24 -0800 (PST) Received: by 10.78.131.11 with HTTP; Sun, 14 Jan 2007 13:49:24 -0800 (PST) Message-ID: <7edfeeef0701141349n61ba7c88u4565f6a560dd65aa@mail.gmail.com> Date: Sun, 14 Jan 2007 16:49:24 -0500 From: "Garrett Rooney" Sender: rooneg@gmail.com To: "Lucian Adrian Grijincu" Subject: Re: New Vista APIs Cc: dev@apr.apache.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <7edfeeef0701060820k717f9465nc775d249e00c408f@mail.gmail.com> X-Google-Sender-Auth: 331b2c4a15e58750 X-Virus-Checked: Checked by ClamAV on apache.org On 1/13/07, Lucian Adrian Grijincu wrote: > the two cond_wait functions in APR: > apr_thread_cond_wait(apr_thread_cond_t *cond, apr_thread_mutex_t *mutex) and > apr_thread_cond_timedwait (apr_thread_cond_t *cond, apr_thread_mutex_t > *mutex, apr_interval_time_t timeout) > > use a apr_thread_mutex_t as the object being unlocked. > > the new condition variable form Vista unlocks either a CriticalSection > or a SRWLock object (SleepConditionVariableCS and > SleepConditionVariableSRW) > > the win32 implementation for apr_thread_mutex_t on Vista uses either > Events or CriticalSections depending on weather > APR_THREAD_MUTEX_UNNESTED was specified when the lock was constructed > or not. > > We can't just use the new calls on Vista because we can't atomically > "release" an event and sleep on the condition variable. > > Because of this we'll need a new constructor > apr_thread_cond_create2 (apr_thread_cond_t **cond, > apr_int32_t * flag, > apr_pool_t * pool) > > and have the developer specify which kind of lock he's going to use > with this lock. > If he chooses to use APR_THREAD_MUTEX_UNNESTED locks, we'll revert to > the current implementation. If he guarantees he won't use these kind > of locks we can freely use the new Condition variables. > > anyways, my former question stands: how would you like apr to deal > with this issue: have a secondary constructor, or have a new set of > objects (or just forget about it)? In general, it seems like if we can't provide a cross-platform API with this new low level interface, I don't see the point in using it at all... If it's absolutely going to require new interfaces with special cases to make it work, then I'm not sure what the real benefit would be. I mean this is a "Portable Runtime", after all. -garrett