sysmips syscall
Hi,
The following lines appear in the linuxthreads/sysdeps/mips/pt-machine.h file in version
LinuxThreads 2.1.2:
TODO: This version makes use of MIPS ISA 2 features. It won't
work on ISA 1. These machines will have to take the overhead of a sysmips(MIPS_ATOMIC_SET, ...) syscall which isn't implemented yet correctly. There is however a better solution for R3000 uniprocessor machines possible.
My questions are:
1. Is the sysmips syscall implemented correctly yet? 2. What is the better solution for R3000 uniprocessor machines? 3. Does anyone have a patch for LinuxThreads that supports MIPS ISA 1?
Thanks and regards,
Rajesh
Quoted 11 lines · On Fri, Nov 17, 2000 at 07:28:50PM -0600, [email protected] wrote:
The following lines appear in the
linuxthreads/sysdeps/mips/pt-machine.hfile in version
LinuxThreads 2.1.2:TODO: This version makes use of MIPS ISA 2 features. It won't
work on ISA 1. These machines will have to take the overhead of asysmips(MIPS_ATOMIC_SET, ...)syscall which isn't implemented yet correctly. There is however a better solution for R3000 uniprocessor machines possible.My questions are:
1. Is the sysmips syscall implemented correctly yet?
Yes.
Quoted 1 line
2. What is the better solution for R3000 uniprocessor machines?
You can base a spinlock implementation on the fact that the register k0 will be left at a value != zero after any exception, also including context switches.
Problem: this solution breaks silently on multiproessor systems.
Quoted 1 line
3. Does anyone have a patch for LinuxThreads that supports MIPS ISA 1?
glibc 2.2's pthread will do that out of the box.
Ralf
Quoted 5 lines · Ralf Baechle
You can base a spinlock implementation on the fact that the register k0 will be left at a value != zero after any exception, also including context switches.
Problem: this solution breaks silently on multiproessor systems.
Use Dekker's algorithm between systems. It requires cache coherent memory but does not need any inter cpu locking mechanisms.
http://www.cs.wvu.edu/~jdm/classes/cs356/notes/mutex/Dekker.html
describes the algorithm for the two cpu case. It assumes no preemption on each cpu so it has to be modified to handle interrupts. Add a local lock so you are the only code on this processor trying to use Dekker between processors.
Quoted 8 lines · Keith Owens
Quoted 5 lines · Ralf Baechle
You can base a spinlock implementation on the fact that the register k0 will be left at a value != zero after any exception, also including context switches.
Problem: this solution breaks silently on multiproessor systems.
Quoted 8 lines
Use Dekker's algorithm between systems. It requires cache coherent memory but does not need any inter cpu locking mechanisms.
http://www.cs.wvu.edu/~jdm/classes/cs356/notes/mutex/Dekker.html
describes the algorithm for the two cpu case. It assumes no preemption on each cpu so it has to be modified to handle interrupts. Add a local lock so you are the only code on this processor trying to use Dekker between processors.
We're talking about a algorithem to implement atomic operations only in userspace. There is Dekker and few improved variants of it. They all got in common that they're performing badly for an increasing number of threads even for the no-contention case. And non-constant memory requirements which would require further changes to glibc. So I consider this whole family of algorithems to be a entirely theoretical construct. Which is why we're thinking about those crude hacks.
Ralf
Quoted 2 lines
Use Dekker's algorithm between systems. It requires cache coherent memory but does not need any inter cpu locking mechanisms.
Cache coherent and write ordered