Skip to content

Using Isahc in a multi-threaded web server #78

Answered by sagebind
kathampy asked this question in Questions
Discussion options

You must be logged in to vote

While libcurl is Isahc's greatest strength, it is often its greatest weakness as well. Using a background thread was a compromise that seemed like the only way to interop with futures considering curl's multi interface without extereme hacks.

The core problem is that a curl multi handle is essentially !Send. All easy handles attached to the multi handle must not be used except through the attached multi handle to drive the transfer. Since curl_multi_perform does all the CPU work for all handles in one call, it isn't possible to parallelize this work across multiple threads, and it isn't possible to split each request into its own future that an executor can poll. Either all the requests m…

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sagebind
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #78 on December 09, 2020 04:06.