curl-library
Re: weird timings from curl_easy_getinfo
Date: Fri, 3 Aug 2001 14:30:04 +0300 (GMT)
On Fri, 3 Aug 2001, Daniel Stenberg wrote:
> On Sat, 21 Jul 2001, Oleg Bartunov wrote:
>
> > Seems this list is quite dead :-)
>
> You mean only 45 mails in a single month means "dead" ? ;-)
>
I was too harry :-)
> I'm back. I'm here. I'll try to respond to every posted mail that need my
> attention. Just wait.
>
> > Anyway, I did some experiment with
> > pthread_mutex_lock/pthread_mutex_unlock and found that indeed libcurl
> > isn't thread-safe.
>
> Could you be more specific? If this is the case, it is a bug (or perhaps
> several bugs).
>
> Did you do init/perform/cleanup properly for each thread?
yes, I followed documentation
>
> > When I lock curl_easy_perform and output I got right numbers but I lost
> > all benefits from using thread ! Something is wrong in progress.c -
> > different threads could interfere.
>
> This should be corrected. Can you detect why/where/when this happens?
>
>
unfortunately I'm not a real C-programmer, but
I attached an archive with my test application,
compile it as
gcc -D_REENTRANT -Wall -I/usr/include -g -O0 -o a.out tt.c out.c -lcurl -L/usr/lib -lpthread
program reads URL's from STDIN, if you need URL files I used I could send it
too, it's quite large (1Mb gzip-compressed) and has nothing specific for
the problem. Just get several URL's and make copies of them. Better use
some URL's with timeouts.
run program as : cat URL | ./a.out
There is #define in tt.c - QUEUE, if it's defined program will works
like one-threaded application because curl_easy_perform will be under
pthread_mutex_lock, undef QUEUE to get real multithreaded process.
From my observation, I get weird timings only if QUEUE is undef'ed and
effect is more distinct if the number of threads is big.
I used 100 threads.
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83
_______________________________________________
Curl-library mailing list
http://curl.haxx.se/libcurl/
- APPLICATION/octet-stream attachment: tt.tar.gz