cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Windows people -- help needed!

From: Alexander J. Oss <alexoss_at_verizon.net>
Date: Wed, 29 Jan 2003 00:56:27 -0500

I'm sorry if my Windows multithreading experience isn't up to snuff, but if
you use CreateThread and WaitForSingleObject with a timeout, and the timeout
occurs, what can you do about it? I don't believe there's a reliable way to
terminate a thread (the docs say "The TerminateThread and TerminateProcess
functions should be used only in extreme circumstances, since they do not
allow threads to clean up, do not notify attached DLLs, and do not free the
initial stack."); and if you're suggesting that it's the thread calling
gethostbyname() that calls WaitForSingleObject, then if the call to
gethostbyname() blocks, you never get to WaitForSingleObject...

----- Original Message -----
From: "Chris Russell" <cdr_at_encapsule.com>
To: <curl-library_at_lists.sourceforge.net>
Sent: Tuesday, January 28, 2003 1:43 PM
Subject: Re: Windows people -- help needed!

Using WSAAyncGetHostByName is *way* overkill. Creating Windows message pump
to catch messages is really not required as we can do this entirely with
CreateThread and WaitForSingleObject - no message pumps, no hidden
windows....

----- Original Message -----
From: <RBramante_at_on.com>
To: <curl-library_at_lists.sourceforge.net>
Sent: Tuesday, January 28, 2003 12:55 PM
Subject: Re: Windows people -- help needed!

If you give me a pointer on what is needed I will try to take a look at #1.

As far as #2, I can test this function out for you. One note: there is
already a non-blocking call on windows to perform hostname resolution
(WSAAsyncGetHostByName) I think this is how most Win32 applications would
probably try to do something like this rather than using another thread
(i.e. issue request, set timer, wait for either resolve or timeout). I
think it depends on how far down the road you want to start putting Win32
specific code into curl. You obviously will be using Win32 specific calls
in either case, but the async calls require the creation of a hidden window
to deliver messages to, etc,. so maybe that is a more "intrusive" solution
than the one presented....

                      Daniel Stenberg
                      <daniel_at_haxx.se> To: libcurl
Mailing list <curl-library_at_lists.sourceforge.net>
                      Sent by: cc:
                      curl-library-admin_at_lists.sour Subject: Windows
people -- help needed!
                      ceforge.net

                      01/28/2003 11:22 AM
                      Please respond to
                      curl-library

1)

Bug report #607604 was fixed a long time ago for non-windows platforms, and
I
just want to ask if there's anyone out there who could possibly consider
helping us closing the report by fixing this in the windows version as
well?

http://sourceforge.net/tracker/index.php?func=detail&aid=607604&group_id=976
&atid=100976

2)

There is also this interesting patch in bug report #674095 submitted by
aschiffler, that offers a gethostbyname() that can be aborted with a
timeout
(for Windows). I would like someone to test it/comment it to become subject
for inclusion in an upcoming libcurl version:

http://sourceforge.net/tracker/index.php?func=detail&aid=674095&group_id=976
&atid=100976

--
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
Received on 2003-01-29