On Tue, 19 Jul 2022, Thomas de Toulmon via curl-library wrote:

I have the following issue in my code. I call curl_easy_perform (via the cpr library) and it spawns a new thread. I was able to verify that this is precisely the call to curl_easy_perform that spawns a new thread and terminates it before returning.

Is there a way I can prevent this from happening? I.e. to have curl_easy_perform run in the current thread and prevent it from spawning a new thread?

If you use a libcurl built to use the threaded resolver (which is the default one), libcurl will fire up a new thread for resolving names. That's a built-in choice. The thread is only used for resolving names and nothing else.

You can opt to build libcurl with the stock synch resolver or with c-ares, but those choices then come with other possible downsides.

--

 / daniel.haxx.se
 | Commercial curl support up to 24x7 is available!
 | Private help, bug fixes, support, ports, new features
 | https://curl.se/support.html
--
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to