curl-library
Re: Multi-threaded connection re-use
Date: Sat, 11 Oct 2014 11:51:39 +0200 (CEST)
On Sat, 11 Oct 2014, Peter Kakoma wrote:
(I'm CC'ing my response over to the libcurl list so that other interested
parties get to see what might be happening and can contribute or just be
informed.)
>> The idea isn't new and we (in the curl project) have thought about before
>> how it could or should be done, but there's not yet any code in libcurl
>> that enables it.
> I'd love to jump in on implementing support; I need the feature enough to
> take the steps through what in my head is a steep learning curve. Off to
> look through the code. Any pointers are more than welcome
Excellent!
A few immediate pointers:
1 - join and discuss details and implementation on the curl-library list, as
that's where all the libcurl hacking is done. This list (curl-and-php) is
for the PHP binding. (and I'm not a PHP guy, really)
2 - The API to share connections between handles would be done using the share
interface. Read up how it works today and how it can already share things
between handles as a good introduction.
3 - See 'struct conncache' and lib/conncache.[ch] for the implementation
details on how the connection cache works. You basically need a way to
lock the access and exclusively extract a connection for use, so that
multiple independent handles can be made to share a single pool.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2014-10-11