On Fri, 23 Jan 2004 10:24:30 -0500, [EMAIL PROTECTED] (Dan Sugalski) wrote: > If you're accessing shared data, it has > to be locked. There's no getting around that. The only way to reduce > locking overhead is to reduce the amount of data that needs locking. >
One slight modification I would make to that statement is: You can reduce locking overhead by only invoking that overhead that overhead when locking is necessary. If there is a 'cheaper' way of detecting the need for locking, then avoiding the cost of locking, by only using it when needed is beneficial. This requires the detection mechanism to be extremely fast and simple relative to the cost of aquiring a lock. This was what I attempted to describe before, in win32 terms, without much success. I still can't help tinking that other platforms probably have similar possibilities, but I do not know enough of them to describe the mechanism in thise terms. Nigel.