From owner-freebsd-arch@FreeBSD.ORG Sun Mar 18 05:48:00 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0C2C16A401 for ; Sun, 18 Mar 2007 05:48:00 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF0013C480 for ; Sun, 18 Mar 2007 05:48:00 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (b82u7f8nxchx8ena@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id l2I5X90k029943; Sat, 17 Mar 2007 21:33:09 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id l2I5X8aY029942; Sat, 17 Mar 2007 22:33:08 -0700 (PDT) (envelope-from jmg) Date: Sat, 17 Mar 2007 21:33:07 -0800 From: John-Mark Gurney To: Max Laier Message-ID: <20070318053307.GC73385@funkthat.com> Mail-Followup-To: Max Laier , freebsd-arch@freebsd.org, freebsd-threads@freebsd.org References: <45F906ED.8070100@aueb.gr> <200703151827.39963.max@love2party.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200703151827.39963.max@love2party.net> User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: freebsd-threads@freebsd.org, freebsd-arch@freebsd.org Subject: Re: Multithreaded qsort(3) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Mar 2007 05:48:00 -0000 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... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."