cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: GetTickCount vs QueryPerformanceCounter

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 27 May 2010 10:43:42 +0200 (CEST)

On Wed, 26 May 2010, Ragnar Lonn wrote:

>> re there any drawbacks in using that function? In what windows versions is
>> QueryPerformanceCounterd available?
>
> I have been using it in Windows 95, 98, NT, 2000 and XP. It seems to exist
> in most moderately modern Windows systems, but read this first:
> http://www.virtualdub.org/blog/pivot/entry.php?id=106

Thanks a lot, those seems to be rather dramatic drawbacks.

I'm also thinking that perhaps this is a problem that may happen for other
users on other operating systems etc, and it might be a reason for us to
consider this a more generic libcurl problem.

One thing that also struck me is that libcurl already has a provision (since
7.18.2) that makes it add 1000 microseconds to the check time, so if the
timeout fires off less than 1 millisecond before the actual timeout shouldn't
be a problem. Can you (Igor) confirm that you're using at least this version
and that this addition really doesn't help? Are you perhaps more than 1000
microsekunds off?

So a question:

If curl_multi_socket_action() is called with a timeout action, and it finds no
timeout action to run for the particular handle since none has yet expired.
Wouldn't it make sense if the function would call the timout callback (again)
and inform the app about the still existing timeout?

Would it help this situation, or would it create a crazy busy loop since the
app will continuously believe the timeout has expired?

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-05-27