Thread (11 messages) 11 messages, 5 authors, 2006-08-29

RE: atomic operations in user space

From: Liu Dave-r63238 <hidden>
Date: 2006-08-29 10:05:34

quoted
quoted
quoted
2) These mutexes are based on futexes which requires atomic=20
operations in userspace. These are available on most=20
architectures.
quoted
Look at
quoted
quoted
the glibc code in
nptl/sysdeps/unix/sysv/linux/powerpc/lowlevellock.h for instance.
Use that and your PPC manual to implement your atomic operations.
No matter semaphore or futex, it uses system calls to kernel.
=20
There is only a system call if there is congestion - that is=20
the whole idea behind the futex.
=20
quoted
quoted
And the
true atomic operation is in kernel not user space.
=20
"True" atomic operations are available in user space on most=20
architectures.
=20
quoted
quoted
Maybe
it's feasible
for other architectures to do atomic operations directly in user=20
space.
IMHO, not for powerpc.
=20
It is available for PowerPC, but not in POWER and POWER2=20
instructionsets according to=20
http://www.nersc.gov/vendor_docs/ibm/asm/lwarx.htm#idx607
It is the same in the ARM world: Atomic instructions was introduced in
ARMv6 I believe. Older ARM processors don't have them.
=20
quoted
Are you meaning that we didn't do atomic operations directly in user
space
on powerpc platform ?
=20
Well, that is not the conclusion I get either when reading=20
the glibc code.
Try to look at glibc-2.3.5/sysdeps/powerpc/bits/atomic.h.
=20
This is by the way probably what the original post in this=20
thread wanted=20
in the first place!
=20
Esben
I totally agree with you and Brant about it. I don't believe we cannot
do the atomic operation in user space on powerpc.

-DAve=20
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help