Subject: Re: gethostbyname & gethostbyaddr in libc thread-safe yet?
To: Alicia da Conceicao <alicia@engine.ca>
From: None <itojun@iijlab.net>
List: tech-net
Date: 05/26/2004 14:26:17
>> > The manual page of getaddrinfo is out of date (it is thread-safe in
>> > NetBSD-current). I would suggest to look into linking with the lwres_
>> > library that comes with bind9. Other than that, you can use mutexes
>> > to protect the current gethostbyfoo(), but that will make it really
>> > slow. Another approach is to fork, which is worse.
>> 	no, getaddrinfo is not thread-safe yet in netbsd-current.
>> 	getadddrinfo: _yp_getaddrinfo, see variable __ypcurrent
>Dammit, I just finished modifing my code to replace all of the "gethostbyname"
>& "gethostbyaddr" routines with "getaddrinfo" & "getnameinfo", since I thought
>these are thread-safe in NetBSD-current.  (BTW I am running NetBSD 2.0E.)
>Since "getaddrinfo" & "getnameinfo" are not thread-safe, I will have to code
>in yet another alternative.

	for now, wrap them by lock primitives, it is the easiest way.
	(or, the offending variables are in YP, so if you do not use YP it
	might be ok...)

itojun