From: "sankar" <san_madhav@hotmail.com>
To: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>,
"Tim Hockin" <thockin@hockin.org>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: Question on atomic_inc/dec
Date: Wed, 15 Oct 2003 10:28:34 -0700 [thread overview]
Message-ID: <Sea2-DAV70ztBOZvchi0000368d@hotmail.com> (raw)
In-Reply-To: A20D5638D741DD4DBAAB80A95012C0AED78656@orsmsx409.jf.intel.com
Hi,
any solution to the original problem???
(atomic_inc() defintion not there in redhat 9.0 asm/atomic.h)
----- Original Message -----
From: "Perez-Gonzalez, Inaky" <inaky.perez-gonzalez@intel.com>
To: "Tim Hockin" <thockin@hockin.org>
Cc: "sankar" <san_madhav@hotmail.com>; <linux-kernel@vger.kernel.org>
Sent: Tuesday, October 14, 2003 3:29 PM
Subject: RE: Question on atomic_inc/dec
> From: Tim Hockin [mailto:thockin@hockin.org]
>
> On Tue, Oct 14, 2003 at 02:17:49PM -0700, Perez-Gonzalez, Inaky wrote:
> > It will be in include/asm/atomic.h; however, it is not wise to
> > use directly the kernel stuff unless you are coding kernel stuff.
>
> Is there any reason NOT to use the atomic ops in user-space? I mean, are
> they privileged on some architectures, or ...? It seems like some
> user-space apps might really benefit from simple atomic ops. Or at least,
> kernel-coders writing in userspace could sure use simple atomic ops :)
Well, you are right; functionally speaking, there are no concerns,
however, there are problems.
Not all architectures have really simple atomic operations like
for example, ia32 or PPC. For example, Sparc has to do this ugly
spinlock thinguie and that's why you can only count on 24 bits
out of the whole atomic data type; another example is ARM,
you just disables irqs and preemption, I guess, and operates), there
is no way they will work in user space
When you have implementations like this, where ia32 is one of the
lucky exceptions because you can do it with a couple of asm opcodes,
it is really impossible to offer something that can float up to
user space.
PS: hey, how's Mike doing? Say hi from me, pls
Iñaky Pérez-González -- Not speaking for Intel -- all opinions are my own
(and my fault)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2003-10-15 17:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-14 22:29 Question on atomic_inc/dec Perez-Gonzalez, Inaky
2003-10-15 17:28 ` sankar [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-10-15 17:38 Perez-Gonzalez, Inaky
2003-10-14 21:17 Perez-Gonzalez, Inaky
2003-10-14 21:34 ` sankar
2003-10-14 21:44 ` Tim Hockin
2003-10-14 22:35 ` David S. Miller
2003-10-15 7:57 ` Arjan van de Ven
2003-10-14 18:38 sankar
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=Sea2-DAV70ztBOZvchi0000368d@hotmail.com \
--to=san_madhav@hotmail.com \
--cc=inaky.perez-gonzalez@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thockin@hockin.org \
/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