Date: Tue, 27 Apr 2010 15:05:42 -0700 From: Alfred Perlstein <alfred@freebsd.org> To: "K. Macy" <kmacy@freebsd.org> Cc: Piotr Honik <piotr.honik@eranet.pl>, freebsd-threads@freebsd.org Subject: Re: Advice / best practice - thread connection pools / mutexes Message-ID: <20100427220542.GH35381@elvis.mu.org> In-Reply-To: <l2m82c4140e1004271437tcdb2b2ack46adc16a728a86cf@mail.gmail.com> References: <6AD0A971B01FA1DE632BAF65@HPQuadro64.dmpriest.net.uk> <4BD737AA.3000200@eranet.pl> <l2m82c4140e1004271437tcdb2b2ack46adc16a728a86cf@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
* K. Macy <kmacy@freebsd.org> [100427 15:01] wrote: > I used lock-less ring buffer for passing newly accepted sockets to a > thread pool. > > I can post the code if it is of interest. That would be very interesting! please do. > > > On Tue, Apr 27, 2010 at 12:14 PM, Piotr Honik <piotr.honik@eranet.pl> wrote: > > Why don't you consider implementing a full manager-worker model? > > Tracking multiple mutexes and conditional waiting when you hit 100+ threads > > isn't going to give you good performance. > > I would be looking at a separate thread doing one thing only - performing > > database queries on behalf of worker threads. > > > > This approach has several advantages: > > ?- the size of ?the 'pool' controlled easily > > ?- mutexes locked only by one thread > > ?- worker threads don't care about db connection, they only talk to the > > manager > > ?- good starting point to develop a complete round-robin solution with > > several db servers > > > > PH. > > _______________________________________________ > > freebsd-threads@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" -- - Alfred Perlstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100427220542.GH35381>