Boost logo

Boost :

From: Scott (cheesy4poofs_at_[hidden])
Date: 2007-10-25 13:53:38

I'm writing an application that runs on both Win32 (vs 2005) and Linux
(gcc). I was curious what the performance penalty is for a scenario like

        recursive_mutex::scoped_lock lock(mutex); // acquire initial mutex

        recursive_mutex::scoped_lock lock(mutex); // increment lock count

Relatively speaking, how much time does it cost to
1) Locking the mutex initially and increment the lock count
2) Determine that a mutex is already locked by the thread and just increment
the lock count?

I'm also curious how much faster mutex is over recursive_mutex for both
platforms. If anybody has done performance profiling or just knows in
general the different mutex scenario performance costs, I'd greatly
appreciate any info. :)

Thanks very much,

Boost list run by bdawes at, gregod at, cpdaniel at, john at