[Opendnssec-develop] performance test

Rickard Bellgrim rickard.bellgrim at iis.se
Wed Mar 9 08:01:18 UTC 2011

On 9 mar 2011, at 08.36, Matthijs Mekking wrote:

> On 03/08/2011 06:03 PM, Rickard Bellgrim wrote:
>> Just to be safe, shouldn't the locks of the queue be handled within the pop and push functions? So that the thread safety is handled by the queue and not someone else.
> My school of thought is that the user of the shared element (queue in
> this case) should lock and unlock, not the shared element itself.

Yes, and I am from the C++ area with threads safe objects :)

>>> Is the queue locked while the drudger is waiting for the condition?
> No, the queue is only locked when pushing an item:
> http://trac.opendnssec.org/browser/trunk/OpenDNSSEC/signer/src/signer/rrset.c#L1140
> and popping an item:
> http://trac.opendnssec.org/browser/trunk/OpenDNSSEC/signer/src/daemon/worker.c#L513

But how come you are sending in the lock of the queue here:

and then locking it here:

// Rickard

More information about the Opendnssec-develop mailing list