lkml.org 
[lkml]   [2008]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 3/3] posix timers: use SIGQUEUE_CANCELLED when the timer is destroyed


On Sun, 18 May 2008, Linus Torvalds wrote:
>
> So the rule is that if one bit of a word needs locking, then they *all*
> do.

Side note: the alternative, of course, is to just use the atomic bit
operations. They aren't generally much (if at all) faster than locking +
doing the operation + unlocking, but they can avoid lock contention, so
if you do a lot of bit ops that need no other locking than the setting and
clearing (possibly with testing), then they are the right choice.

For signals, we obviously need other locking, so the atomic bit ops are a
waste of time (doing *both* locking for other reasons *and* atomic bitops
is obviously much slower than either).

Linus


\
 
 \ /
  Last update: 2008-05-18 19:45    [W:0.051 / U:1.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site