[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <p73fxx4mxa1.fsf@bingen.suse.de>
Date: Fri, 11 Jan 2008 12:12:06 +0100
From: Andi Kleen <andi@...stfloor.org>
To: Nikanth Karthikesan <knikanth@...e.de>
Cc: linux-kernel@...r.kernel.org, mpm@...enic.com
Subject: Re: Query on lock protection in random number driver
Nikanth Karthikesan <knikanth@...e.de> writes:
>
> Also the globals random_read_wakeup_thresh and
> random_write_wakeup_thresh are not at all protected by any locks! Why
> locks are not needed for these?
Reading variables sizeof <= native word size (32bit or 64bit depending
on architecture) is atomic by itself. This is not necessarily
guaranteed in ISO-C or POSIX threads, but Linux can assume that.
-Andi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists