Advice / best practice - thread connection pools / mutexes

Alfred Perlstein alfred at freebsd.org
Wed Apr 28 14:11:09 UTC 2010


* Karl Pielorz <kpielorz_lst at tdx.co.uk> [100428 04:56] wrote:
> 
> --On 28 April 2010 04:12 -0700 Alfred Perlstein <alfred at freebsd.org> 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!).

I'd keep an eye out for Kip's version, it's likely to be a lot
faster. :)

-- 
- Alfred Perlstein
.- AMA, VMOA #5191, 03 vmax, 92 gs500, 85 ch250, 07 zx10
.- FreeBSD committer


More information about the freebsd-threads mailing list