curl / Mailing Lists / curl-library / Single Mail


curl handles and multi thread

From: surya chandrika via curl-library <>
Date: Wed, 8 Nov 2017 15:25:15 +0530

Hi all,

From this link it says

You must never share the same handle in multiple threads. You can pass the
handles around among threads, but you must never use a single handle from
more than one thread at any given time.

Usecase: (cpp)
1. Get a multi handle and post an async req
2. If still_running = 1 push them into a global map
3. another thread which actively parse this map to select() the handles.
(one thread dedicated for selection for pending request)
4. If an activity is detected another thread from threadpool perform multi

So using a proper locking mechanism i understand that i should be able
to perform the above without any exception.

Please let me know if this understanding is correct.


Received on 2017-11-08