On 03/18/2014 06:58 PM, Jim Starkey wrote:

> Do you really use a mutex to when walking a structure????  Why not a
> read/write lock?  With a mutex, readers block readers, which is a total
> waste of cycles, thread stalls, thread switches, etc.
>

That mutex is also needed to increment thread enter count for 
attachment. Certainly, I can use rwlock and atomic counter, therefore 
getting non-blocking combination, but that means one more atomic 
operation. Taking into an account that for each yvalve enter mutex is 
locked for a very small time slice and it's not global, it's 
per-attachment, I estimate possibility of conflict on it as very little. 
Suppose saving extra atomic operation per each yvalve enter is better.



------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to