Re: atomic RAM ?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alan Cox
Date: Friday, April 9, 2010 - 4:54 am

> If "you" is You that might be true. But if "you" is me its utterly and

You are completing missing the point

Linux + glibc platforms don't "need" futex - you need fast user space
locks. Futex is an implementation of those locks really based around
platforms with atomic instructions. People were doing fast user space
locks before Linus was even born and on machines without atomic
operations.

Seperate out
- the purpose for which the system exists (fast user locking)
- the interfaces by which it must be presented (posix pthread mutex)
- the implementation of the system


Nope. Glibc allows you to implement arch specific code for these locks
which may not be FUTEX but need not be kernel based. The user space
mechanics of the futex stuff include platform specific stuff for all
platforms. You might do the blocking kernel parts of it via the futex
syscall but what matters are the uncontended fast paths which are arch
specific C library code.


You clearly need a pthread_mutex that is fast - but the idea that this
means FUTEX is misleading and futex on each platform in the user space
side is different per architecture anyway.

The idea that you need atomic operations to do fast user space locking is
also of course wrong - you only need store ordering.


Alan
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
atomic RAM ?, Michael Schnell, (Thu Apr 8, 12:32 am)
Re: atomic RAM ?, Michael Schnell, (Thu Apr 8, 2:52 am)
Re: atomic RAM ?, Michael Schnell, (Thu Apr 8, 3:12 am)
Re: atomic RAM ?, Alan Cox, (Thu Apr 8, 3:45 am)
Re: atomic RAM ?, Michael Schnell, (Thu Apr 8, 5:11 am)
Re: atomic RAM ?, David Miller, (Thu Apr 8, 5:14 am)
Re: atomic RAM ?, Michael Schnell, (Thu Apr 8, 5:30 am)
Re: atomic RAM ?, Alan Cox, (Thu Apr 8, 6:37 am)
Re: atomic RAM ?, Arnd Bergmann, (Thu Apr 8, 7:15 am)
Re: atomic RAM ?, Mike Frysinger, (Thu Apr 8, 6:36 pm)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 2:23 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 3:54 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 3:55 am)
Re: atomic RAM ?, Alan Cox, (Fri Apr 9, 4:54 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 5:53 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 6:14 am)
Re: atomic RAM ?, Alan Cox, (Fri Apr 9, 6:15 am)
Re: atomic RAM ?, Michael Schnell, (Fri Apr 9, 6:32 am)
Re: atomic RAM ?, Michael Schnell, (Mon Apr 12, 2:58 am)
Re: atomic RAM ?, Pavel Machek, (Mon Apr 12, 5:54 am)
Re: atomic RAM ?, Arnd Bergmann, (Mon Apr 12, 8:02 am)
Re: [Nios2-dev] atomic RAM ?, Michael Schnell, (Tue Apr 13, 1:39 am)
Re: atomic RAM ?, Michael Schnell, (Tue Apr 13, 3:11 am)
Re: atomic RAM ?, Michael Schnell, (Wed Apr 14, 1:42 am)
Re: atomic RAM ?, Michael Schnell, (Wed Apr 14, 5:46 am)
Re: atomic RAM ?, Alan Cox, (Wed Apr 14, 5:57 am)
Re: atomic RAM ?, Michael Schnell, (Wed Apr 14, 7:38 am)