cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Advantages of mutli handle over multithread easy handle

From: Vladimir Grishchenko <vladgri_at_hotmail.com>
Date: Tue, 12 Apr 2011 10:49:43 -0700

>
> This could be novice question.
>
> What would be the advantages of using a multi handle over using
> multiple threads using easy handles (referring to example
> multithread.c) ?
>
> I understand the multihandle is non blocking, but how would that help
> me if I’m writing an ftp client ?
>
>
>
> Thanks and regards,
>
>
>
> Vishakha
>

From novice to novice - as someone already mentioned the multi-handle approach is more scalable as you can get away with single thread servicing multiple connections. Whether or not this is important to you only you can answer - if you're writing an app that will have to open hundreds of simultaneous connections or perhaps have limited resources on an embedded device then multi is the way to go, however for a desktop app that deals only with a handful of connections the easy mechanism should be sufficient and probably with less code to write. As for blocking vs. non-blocking I think it is important to understand that both mechanisms use non-blocking sockets unless they are specifically disabled at compile time.

-V
                                               
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-04-12