aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-08-22 19:39:19 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-08-22 19:39:19 +0000
commit6b975c308c9b93b058a0d0f718bb350ae64b9dd1 (patch)
tree5ff115066947c1c1ef49e2225acad430815df5fa
parent74be55a477887a4ac77fef9b088b906dbe174284 (diff)
Markus F.X.J. Oberhumer added a section about NOSIGNAL and libcurl in
multi-threaded use
-rw-r--r--docs/libcurl-the-guide18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/libcurl-the-guide b/docs/libcurl-the-guide
index 8c41693f5..a196d8ead 100644
--- a/docs/libcurl-the-guide
+++ b/docs/libcurl-the-guide
@@ -116,6 +116,7 @@ Global Preparation
Repeated calls to curl_global_init() and curl_global_cleanup() should be
avoided. They should only be called once each.
+
Handle the Easy libcurl
libcurl version 7 is oriented around the so called easy interface. All
@@ -215,6 +216,23 @@ Handle the Easy libcurl
previous
+Multi-threading issues
+
+ libcurl is completely thread safe, except for two issues: signals and alarm
+ handlers. Signals are needed for a SIGPIPE handler, and the alarm() syscall
+ is used to catch timeouts (mostly during DNS lookup).
+
+ So when using multiple threads you should first ignore SIGPIPE in your main
+ thread and set the CURLOPT_NOSIGNAL option to TRUE for all handles.
+
+ Everything will work fine except that timeouts are not honored during the DNS
+ lookup - this would require some sort of asynchronous DNS lookup (which is
+ planned for a future libcurl version).
+
+ For SIGPIPE info see the UNIX Socket FAQ at
+ http://www.unixguide.net/network/socketfaq/2.22.shtml
+
+
When It Doesn't Work
There will always be times when the transfer fails for some reason. You might