I now have a Futex testing program up and running.

It performs three tests on different kinds of Mutex implementation for
threads all running the same code:

Test 1: only one thread, many Mutex calls protecting a small critical
section

Test 2: multiple threads many Mutex calls protecting a small critical
section

Test 3: multiple threads, only a few Mutex calls protecting a critical
section that contains a long lasting loop


This is tested with these Futex implementations:

1) Dummy: Of course does not work, but used as reference for estimating
the performance of the different Mutex implementations.

2) A simple protection done with atomic operations and having the thread
do a short sleep if it can't get the lock. (Does not work on the NIOS,
as there are no atomic operations)

3) using the pthread_mutex calls of the pthread library (which does
Futex with X86 vs. some system calls with the NIOS2)

4) a Futex implementation based on the paper "Futexes Are Tricky" by
Ulrich Depper, code variant "Take 2" (not yet done for NIOS)

5) a Futex implementation based on the paper "Futexes Are Tricky" by
Ulrich Depper, code variant "Take 3" (not yet done for NIOS)

6) using Linux System V semaphore. (On the PC, some 10 times slower than
anything else, on NIOS performing very similar to pthread_mutex)

If anybody wants to try it I can post it somewhere.

-Michael
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to