lkml.org 
[lkml]   [2011]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 2/5] signal: Add rwlock to protect sighand->action
From
Date
On Fri, 2011-09-30 at 16:12 +0100, Matt Fleming wrote:
>
> As sighand->action is read much more frequently than written a rwlock
> makes the most sense here.

Ha! you would think so, but then you'd forget that
read_lock()+read_unlock() are atomic ops modifying the lock state as
well. Furthermore rwlocks aren't fair by any means.

Therefore rwlock_t should never be used, use a spinlock_t possibly in
combination with RCU or seqcount etc..


\
 
 \ /
  Last update: 2011-09-30 17:29    [W:0.724 / U:0.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site