Re: Thread safety of getaddrinfo()/getnameinfo()
- In reply to: Paul Floyd : "Re: Thread safety of getaddrinfo()/getnameinfo()"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 27 Apr 2023 16:05:13 UTC
* Paul Floyd <paulf2718@gmail.com> [20230426 22:28]:
> On 26-04-23 19:57, Felix Palmen wrote:
>
> > So, is there a thread-safety issue with these functions, or a bug in
> > valgrind, or maybe just some false positive?
>
> A false positive is a bug.
Well, depends on the definition. It's at least a different class than
e.g. misdetecting what it *should* know about ;)
> I believe that getaddrinfo should be MT safe.
> [...]
> These lock macros use spinlocks. The problem is that Valgrind (both Helgrind
> and DRD) doesn't recognize any locking mechanisms other than pthreads and Qt
> threads.
Thanks a lot for that clarification! So, won't worry about using these
functions on threads any more :)
Cheers, Felix
--
Felix Palmen <zirias@FreeBSD.org> {private} felix@palmen-it.de
-- ports committer (mentee) -- {web} http://palmen-it.de
{pgp public key} http://palmen-it.de/pub.txt
{pgp fingerprint} 6936 13D5 5BBF 4837 B212 3ACC 54AD E006 9879 F231