SOquestion
SOquestion

Reputation: 11

Is the hiperfifo.c example thread safe

I see numerous references on how a curl multi handle should not be used across threads concurrently. However in the hiperfifo.c example, the handle seems to be accessed concurrently from fifo_cb, timer_cb and event_cb. Is it implicit that some synchornization should be added by the curl programmer? Or is libevent serializing the callbacks?

Upvotes: 1

Views: 137

Answers (1)

Daniel Stenberg
Daniel Stenberg

Reputation: 58114

libevent is serializing the callbacks. It works within a single thread.

(and the recently created canonical URL for information about libcurl's threadsafeness is: http://curl.haxx.se/libcurl/c/threadsafe.html)

Upvotes: 1

Related Questions