cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Bug in libcurl in multithreaded program

From: Avery Fay <avery_fay_at_symantec.com>
Date: Mon, 3 Jun 2002 17:51:11 -0400

Sorry, for taking so long to get back to you. I didn't have time to work on
it until today. Anyway, after trying to create a small test program I
realized that I had an error in my program where sometimes I would pass in
a bad pointer for the URL. So, previous problem solved. Now I'm running
into a different one. I ported my program to Windows and everything appears
to work except for FTP transfers. When I run my program getting FTP files
the CPU usage goes to 100% and almost nothing is transferred. A few things
to note:

On linux and FreeBSD: everything is fine regardless of protocol (HTTP,
HTTPS, FTP) and number of threads
On windows: HTTP and HTTPS work fine regardless of number of threads. FTP
is ok until about 4 threads or so and then everything grinds nearly to a
halt.

Anyone have any ideas about this? Has anyone gotten a mulithreaded libcurl
application on windows doing FTP transfers to preform well?

If there are no suggestions, I'll see if I can whip up a little sample
program that causes the above mentioned slow transfers.

On a different note, I'm interested in using the multi interface but I have
a question. If I set CURLOPT_WRITEFUNCTION and it is called by libcurl how
do I know which connection it corresponds to? In a multithreaded
application I can just do a lookup in a table by the thread ID, but
obviously in a situation with multiple connections per thread I can't do
that.

Thanks,
Avery Fay

|---------+---------------------------->
| | Daniel Stenberg |
| | <daniel_at_haxx.se> |
| | |
| | 05/28/2002 06:23 |
| | PM |
| | |
|---------+---------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
  | |
  | To: Avery Fay <avery_fay_at_symantec.com> |
  | cc: libcurl Mailing list <curl-library_at_lists.sourceforge.net> |
  | Subject: Re: Bug in libcurl in multithreaded program |
>------------------------------------------------------------------------------------------------------------------------------|

On Fri, 24 May 2002, Avery Fay wrote:

> Unfortunately, the patch didn't work for me. Same backtrace.

Did you get any further on checking out local variables at the time of the
crashes or on making a stand-alone test program that can repeat this
problem?

--
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
Received on 2002-06-04