From owner-freebsd-threads@FreeBSD.ORG Wed Apr 28 11:56:00 2010 Return-Path: Delivered-To: freebsd-threads@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BDB31065686; Wed, 28 Apr 2010 11:56:00 +0000 (UTC) (envelope-from kpielorz_lst@tdx.co.uk) Received: from mail.tdx.com (mail.tdx.com [62.13.128.18]) by mx1.freebsd.org (Postfix) with ESMTP id 175AA8FC08; Wed, 28 Apr 2010 11:55:59 +0000 (UTC) Received: from HPQuadro64.dmpriest.net.uk (HPQuadro64.dmpriest.net.uk [62.13.130.30]) (authenticated bits=0) by mail.tdx.com (8.14.3/8.14.3/Kp) with ESMTP id o3SBtw5C035997 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Wed, 28 Apr 2010 12:55:58 +0100 (BST) Date: Wed, 28 Apr 2010 12:55:38 +0100 From: Karl Pielorz To: Alfred Perlstein Message-ID: In-Reply-To: <20100428111226.GK35381@elvis.mu.org> References: <6AD0A971B01FA1DE632BAF65@HPQuadro64.dmpriest.net.uk> <20100428111226.GK35381@elvis.mu.org> X-Mailer: Mulberry/4.0.8 (Win32) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: freebsd-threads@FreeBSD.org Subject: Re: Advice / best practice - thread connection pools / mutexes 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: Wed, 28 Apr 2010 11:56:00 -0000 --On 28 April 2010 04:12 -0700 Alfred Perlstein wrote: > The most simple method is to do the following at startup: > > [snip wonderful sample code] > > This should provide for a connection pool, each thread > can then call get_con() to get a connection, and should > call put_con() when done with it. > > good luck. > -Alfred Thanks, that looks pretty much exactly what I'm looking for - thanks also to the other people who replied, I've certainly got a few options now (which is a big improvement on what I had before!). Regards, -Karl