cURL / Mailing Lists / curl-users / Single Mail

curl-users

Thread safety and ConnectionStore

From: Lindley French <lindleyf_at_gmail.com>
Date: Mon, 2 Jun 2014 14:30:24 -0700

Hello,

I am using curl in a multi-threaded context. According to the
documentation, curl is supposed to be completely thread-safe. However,
ThreadSanitizer warns me about the connection_id_counter variable in the
ConnectionStore() method; and indeed, local statics and threads don't go
well together.

I can fix it and make a pull request on github. My question is, what is the
preferred thread safety mechanism with curl? A quick search doesn't turn up
much in the way of mutexes or atomics in the current code. Any suggestions?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-06-02