aboutsummaryrefslogtreecommitdiff
path: root/docs/FAQ
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-05-08 09:30:35 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-05-08 09:30:35 +0200
commit1495f4213897997dab4a6432ceef3d684ccc3b76 (patch)
treefa535e8e6bc3dbfe2dcbb3490c91c1f7d34cf35b /docs/FAQ
parentba06278e9738a40b56954d80be813d4887d220ce (diff)
FAQ: Added 5.18 Does libcurl use threads?
Diffstat (limited to 'docs/FAQ')
-rw-r--r--docs/FAQ14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/FAQ b/docs/FAQ
index 3704f0562..29355f093 100644
--- a/docs/FAQ
+++ b/docs/FAQ
@@ -99,6 +99,7 @@ FAQ
5.15 How do I get an FTP directory listing?
5.16 I want a different time-out!
5.17 Can I write a server with libcurl?
+ 5.18 Does libcurl use threads?
6. License Issues
6.1 I have a GPL program, can I use the libcurl library?
@@ -1365,6 +1366,19 @@ FAQ
server for. And there are really good stand-alone ones that have been tested
and proven for many years. There's no need for you to reinvent them!
+ 5.18 Does libcurl use threads?
+
+ Put simply: no, libcurl will execute in the same thread you call it in. All
+ callbacks will be called in the same thread as the one you call libcurl in.
+
+ If you want to avoid your thread to be blocked by the libcurl call, you make
+ sure you use the non-blocking API which will do transfers asynchronously -
+ but still in the same single thread.
+
+ libcurl will potentially internally use threads for name resolving, if it
+ was built to work like that, but in those cases it'll create the child
+ threads by itself and they will only be used and then killed internally by
+ libcurl and never exposed to the outside.
6. License Issues