From vladimir.levijev at gmail.com Mon Nov 14 15:21:25 2016 From: vladimir.levijev at gmail.com (Vladimir Levijev) Date: Mon, 14 Nov 2016 17:21:25 +0200 Subject: [ldns-users] Is ldns C library thread-safe? Message-ID: Hi, We'd like to perform multiple ldns_resolver_query() calls in a multi-threaded application. For each call different resolver will be used. We would like to use POSIX threads directly or with the help of OpenMP. Is that a good idea? Cheers, VL From willem at nlnetlabs.nl Mon Nov 14 16:00:52 2016 From: willem at nlnetlabs.nl (Willem Toorop) Date: Tue, 15 Nov 2016 01:00:52 +0900 Subject: [ldns-users] Is ldns C library thread-safe? In-Reply-To: References: Message-ID: <15129494-7006-5665-91b0-61cbcb96fde1@nlnetlabs.nl> Yes, ldns is thread-safe in the sense that it doesn't use global variables. It does use libcrypto for cryptographic operations which might not be thread safe. You have to check with the OpenSSL that you are using on how to make sure they can be used thread-safe. Here are some pointers: https://www.openssl.org/docs/man1.0.2/crypto/threads.html https://www.openssl.org/docs/man1.1.0/crypto/CRYPTO_THREAD_run_once.html -- Willem Op 15-11-16 om 00:21 schreef Vladimir Levijev: > Hi, > > We'd like to perform multiple ldns_resolver_query() calls in a > multi-threaded application. For each call different resolver will be > used. We would like to use POSIX threads directly or with the help of > OpenMP. Is that a good idea? > > Cheers, > > VL > _______________________________________________ > ldns-users mailing list > ldns-users at open.nlnetlabs.nl > https://open.nlnetlabs.nl/mailman/listinfo/ldns-users >