From owner-freebsd-threads@FreeBSD.ORG Sun Mar 18 07:10:33 2007 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5B1E916A400 for ; Sun, 18 Mar 2007 07:10:33 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.235]) by mx1.freebsd.org (Postfix) with ESMTP id 1A16113C45A for ; Sun, 18 Mar 2007 07:10:32 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by wx-out-0506.google.com with SMTP id s18so913511wxc for ; Sun, 18 Mar 2007 00:10:32 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Uz+FQ8tUpdeyEIeEtR3jXcKIYdzp5eQp1IqzcvbeuaW0WoQyGyy+jZJQcG0wxQ6ZmhVvbqg+rylHyIncZ7d1FJnpI1uuoxaM856x0oFdOm17MxhOHy8SjGpYxmB3VRBm6PW7k4+Uh5uyIslix2WlQJoEbZ17vxtIVSeuItNMAPA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=kHG2gd4oqx1f4XiWzONM4CigWPk4pEeWT5QOr8CF7xQ8KiWrBh5ubxMm3A/tqyy24sHssg2vUbtuURzX9hYIXLb+C2atw0jlB/G2WUAyGtqaf8Zfm/IaqwnibhwX8nMesR7Y/c3pBCiM4DjRGwh/g7YRqRhJf0ZTwiJWqwzwQrw= Received: by 10.90.27.15 with SMTP id a15mr3083078aga.1174200214965; Sat, 17 Mar 2007 23:43:34 -0700 (PDT) Received: by 10.90.25.1 with HTTP; Sat, 17 Mar 2007 23:43:34 -0700 (PDT) Message-ID: Date: Sat, 17 Mar 2007 23:43:34 -0700 From: "Kip Macy" To: "John-Mark Gurney" , "Max Laier" , freebsd-arch@freebsd.org, freebsd-threads@freebsd.org In-Reply-To: <20070318053307.GC73385@funkthat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <45F906ED.8070100@aueb.gr> <200703151827.39963.max@love2party.net> <20070318053307.GC73385@funkthat.com> Cc: Subject: Re: Multithreaded qsort(3) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2007 07:10:33 -0000 On 3/17/07, John-Mark Gurney wrote: > Max Laier wrote this message on Thu, Mar 15, 2007 at 18:27 +0100: > > I'd suggest to name it qsort() and put it in a separate library (not > > necessarily named libc_mt, as I don't believe there are that many > > functions in libc, that can actually gain from multithreading). > > What happens when you attempt to link a library that uses qsort, but > isn't multi-thread safe? You may be able to protect calls to the > library w/ a lock, but then when it calls qsort, the library would > break.. > > Keeping the qsort name sounds ripe for problems down the road... Reminds me of how Solaris blindly uses vfork for implementing system(3). It was very easy for a naive user (me) to call system from a multi-threaded python application. I had numerous failures that were impossible to track back to system(3). -Kip