From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: "wyb@topsec.com.cn" <wyb@topsec.com.cn>
Cc: linux-kernel@vger.kernel.org
Subject: Re: SMP share data declaration
Date: Fri, 14 Jul 2006 10:48:10 +0200 [thread overview]
Message-ID: <9a8748490607140148x70663e27k2f03367165ab4c0b@mail.gmail.com> (raw)
In-Reply-To: <002001c6a6f1$74ff85f0$0100000a@codingman>
On 14/07/06, wyb@topsec.com.cn <wyb@topsec.com.cn> wrote:
> I know that an integer variable should be declared volatile to share between
> CPUs.
NO. volatile won't protect you sufficiently.
Use spinlocks, mutexes, semaphores, barriers and the like to protect
variables from concurrent access. Using volatile for this is a BUG and
it won't work correctly.
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next prev parent reply other threads:[~2006-07-14 8:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-14 2:58 wyb
2006-07-14 8:48 ` Jesper Juhl [this message]
2006-07-14 11:31 ` Hannibal B
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9a8748490607140148x70663e27k2f03367165ab4c0b@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=wyb@topsec.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®