cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Mysterious random crash demystified.

From: Gisle Vanem <giva_at_bgnett.no>
Date: Mon, 11 Oct 2004 21:48:37 +0200

<traian_at_burstcopy.com> wrote:

> Well, that has naturally helped, but I for one would be quite reluctant to
> implement a TerminateThread for such a small synchronization task. It
> would probably do more harm than good.

Since gethostbyname/getaddrinfo are blocking, how do you mean
they should be synchronised? If not by forcefully terminating the thread one
must wait 10-15 sec in curl_easy_cleanup. Or longer if NetBIOS is involved.
IMHO not very nice.

One sollution would be for the thread to detect if the 'connectdata' structure
has been deleted. But that would probably need waiting on a critical-section or
a mutex used during cleanup (Curl_disconnect).

> "If the target thread is executing certain kernel32 calls when it is
> terminated, the kernel32 state for the thread's process could be
> inconsistent."

I haven't heard any such worries/problems about the unix code that uses
alarm() and *longjmp(). Couldn't the state there also get comprimised?

--gv
Received on 2004-10-11