atomic operations under linux
Gilboa Davara
gilboad at gmail.com
Thu Dec 10 10:33:06 IST 2009
On Thu, 2009-12-10 at 08:58 +0200, Shachar Shemesh wrote:
> Gilboa Davara wrote:
> > On Wed, 2009-12-09 at 20:04 +0200, Raz wrote:
> >
> > > Do not use inline kernel atomic_t operation, you will violate GPL.
> > > Use gcc builtins. If you want information please refer to:
> > > http://sos-linux.svn.sourceforge.net/viewvc/sos-linux/offsched/Linux-Debug/
> > > and download linux-debug.pdf . You will few words on atomicity in user
> > > space in linux.
> > > Please execuse for bad editing, the paper is not complete.
> > >
> > > raz
> > >
> >
> > Thanks.
> > While I was aware of the derived problem - I neglected to point it out.
> > Thanks.
> >
> > At least in my case (and partially due to the derived work problem), I
> > simply wrote my own set of assembly functions that worked the same under
> > both Linux/BSD and Windows (under both user mode and kernel mode).
> >
> > - Gilboa
> >
> I might be missing something really basic, but may I ask "why"? What
> would you want to achieve that would require you to use the "get and
> set" (or "test and set", or whatever) in user space?
>
> Shachar
Why?
- Write code that can run more-or-less the same as kernel module and as
a user-space library. (And under multiple different OS')
- Implement fast spinlocks and/or RW locks in user mode. (Again, that
behave the same under kernel mode and user mode.)
- Atomic counters.
- Anything else that can use the "lock" prefix.
- Gilboa
More information about the Linux-il
mailing list