cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: thread stack size

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Sun, 21 Mar 2004 16:37:43 +0100 (CET)

On Sat, 20 Mar 2004, Jean-Yves Lefort wrote:

> In lib/content_encoding.c, a 64k stack buffer is used. On some platforms,
> the default thread stack size is too small to hold that buffer. To use
> libcurl in a multi-threaded program, the programmer has to manually specify
> a thread stack size.
>
> You should explicitly state the required stack size in the documentation
> and/or define some CURL_NEEDED_STACK_SIZE constant.

I think we should fix it to instead dynamicly allocate that memory using
malloc (when found out to be needed the first time), and have a pointer to it
in the curl handle, and free() it later on when the handle is freed.

Any taker?

> This issue might be the cause of the BSD problem reports mentioned in
> http://curl.haxx.se/libcurl/threadsafe.html. For instance, FreeBSD has a 64k
> default thread stack size.

No, this is not the case. The BSD systems have always suffered from lousy
thread code, this is no secret and has nothing to do with anything particular
in curl or libcurl. The problems people have had using multi-threaded programs
on *BSD with curl also appeared long before we even had the content_encoding.c
source file! ;-)

If things have changed in this area during the recent years in BSD land, then
I have a reason to reconsider the wording in the above mention web page.

-- 
    Daniel Stenberg -- http://curl.haxx.se/ -- http://daniel.haxx.se/
   [[ Do not send mails to this email address. They won't reach me. ]]
Received on 2004-03-21