From owner-freebsd-current@FreeBSD.ORG Wed Jan 6 02:38:48 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1397910656B3; Wed, 6 Jan 2010 02:38:48 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id 7667C8FC15; Wed, 6 Jan 2010 02:38:46 +0000 (UTC) Received: by fxm27 with SMTP id 27so2377729fxm.3 for ; Tue, 05 Jan 2010 18:38:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=498EFNd67pVvAaQBT+I6UB1bVcbwj1q/tGnUYNEBxyk=; b=pN7HLa9LDEJUaMMgl7JYDtf8FL24pBdAoSY90LNMGCKIR0CO7t5XoaUXCzmLWs4sRB w0yzhWMqulmdK44PN61lkTH3xiXex15PK/oDrjd+P+msd/LO/EmAPQ/TUWaKiFkJMpMp m5qXygq5cDQ30sJUm8BBdUhT2KDJ9WJBYPuaE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=T98S8NLjs5jQYCQFcGtN7+g5n6XcTscljYOTazWFEh+cD3R0OXrISilzO9S9sGdGtI TLiuetNUm1Yjwdc3i+Bvg9Y3OlpF8Q51avD06/VAcBBO+PAQyMHliFXRxlxq6Au8Yg7J t5DAFln06253QkI9/GKwt2hP+AQgEprTG5oy8= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.143.73 with SMTP id t9mr573441fau.89.1262745515726; Tue, 05 Jan 2010 18:38:35 -0800 (PST) In-Reply-To: <4B43E358.609@freebsd.org> References: <4B43E358.609@freebsd.org> Date: Wed, 6 Jan 2010 03:38:35 +0100 X-Google-Sender-Auth: 54ca9c8ffa4bfa68 Message-ID: <3bbf2fe11001051838t38e872d3jae6c4f8be9e57ebc@mail.gmail.com> From: Attilio Rao To: David Xu Content-Type: text/plain; charset=UTF-8 Cc: FreeBSD Current Subject: Re: process-sharable pthread synchronous objects X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Jan 2010 02:38:48 -0000 2010/1/6 David Xu : > I want to go further to make some pthread synchronous objects > process-sharable, do you guy think it is worthy ? > except mutex and condition variable, others like rwlock and spinlock > are relative simple. I'm afraid people is going to produce very messy system resulting in process shared mutexes where IPC or threads may be used and causing more harms than good. Besides that, semaphore can "emulate" a fair amount of locking features in a non-trivial fashion, forcing developers to think a lot about it, thus reducing the risk of error. Said that, I think that introducing shared semaphore has been a good idea, but I would not go further than that. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein