Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 11957 invoked by uid 500); 31 Jul 2001 20:52:48 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 11940 invoked from network); 31 Jul 2001 20:52:48 -0000 Errors-To: Message-ID: <0b6101c11a02$63dab960$93c0b0d0@roweclan.net> From: "William A. Rowe, Jr." To: "Aaron Bannert" , References: <008901c119e7$f1071ec0$8100a8c0@godzilla> <20010731122140.A21458@ebuilt.com> Subject: Re: Conditionals... Date: Tue, 31 Jul 2001 15:50:07 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N From: "Aaron Bannert" Sent: Tuesday, July 31, 2001 2:21 PM > I've been looking into this over the last few days and although I'm > totally in favor of adding condition variables to APR, I'm not yet > convinced that we can properly implement them on non-POSIX platforms > without some level of kernel support. There is one specific place where > I'm seeing a problem: > > - cond_wait() takes a locked mutex that is associated with the cond. > - it will unlock that mutex and go to sleep > - when it awakens it must immediately reacquire that mutex (awaken() and > acquire() must be a single atomic operation) > - finally, cond_wait() returns. > > Does anyone know of a way around this without some sort of kernel support > to make those two operations atomic? This seems like a serious potential > for race/deadlocks. Oh duh, this is a breeze on win32 [except that cond's themselves must be implemented.] http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/hh/winbase/synchro_5h2s.asp