summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorrpj <rpj>2001-07-05 11:57:32 +0000
committerrpj <rpj>2001-07-05 11:57:32 +0000
commit99e8ecc5759668fd3af379eaddd70b4ae50ecd7f (patch)
tree8b824cc1eb8de6fd15a4b5636f5f62fa95541105 /tests
parent861a8bb5523f257b474f68334c2c5300e52c5371 (diff)
Added new routines from POSIX 1003.1j. This is alpha level code.
* spin.c: New module implementing spin locks. * barrier.c: New module implementing barriers. * pthread.h (_POSIX_SPIN_LOCKS): defined. (_POSIX_BARRIERS): Defined. (pthread_spin_*): Defined. (pthread_barrier*): Defined. (PTHREAD_BARRIER_SERIAL_THREAD): Defined. * implement.h (pthread_spinlock_t_): Defined. (pthread_barrier_t_): Defined. (pthread_barrierattr_t_): Defined. * mutex.c (pthread_mutex_lock): Return with the error if an auto-initialiser initialisation fails. * nonportable.c (pthread_getprocessors_np): New; gets the number of available processors for the current process.
Diffstat (limited to 'tests')
-rw-r--r--tests/README.benchtests66
1 files changed, 66 insertions, 0 deletions
diff --git a/tests/README.benchtests b/tests/README.benchtests
new file mode 100644
index 0000000..1d8e1e3
--- /dev/null
+++ b/tests/README.benchtests
@@ -0,0 +1,66 @@
+
+------------
+Benchmarking
+------------
+There is a new but growing set a benchmarking programs in the
+"tests" directory. These should be runnable using the
+following command-lines corresponding to each of the possible
+library builds:
+
+MSVC:
+nmake clean VC-bench
+nmake clean VCE-bench
+nmake clean VSE-bench
+
+Mingw32:
+make clean GC-bench
+make clean GCE-bench
+
+UWIN:
+The benchtests are run as part of the testsuite.
+
+
+Mutex benchtests
+----------------
+
+benchtest1 - Lock plus unlock on an unlocked mutex.
+benchtest2 - Lock plus unlock on a locked mutex.
+benchtest3 - Trylock on a locked mutex.
+benchtest4 - Trylock plus unlock on an unlocked mutex.
+
+
+Each test times up to three alternate synchronisation
+implementations as a reference, and then times each of
+the four mutex types provided by the library. Each is
+described below:
+
+Simple Critical Section
+- uses a simple Win32 critical section. There is no
+additional overhead for this case as there is in the
+remaining cases.
+
+POSIX mutex implemented using a Critical Section
+- The old implementation which uses runtime adaptation
+depending on the Windows variant being run on. When
+the pthreads DLL was run on WinNT or higher then
+POSIX mutexes would use Win32 Critical Sections.
+
+POSIX mutex implemented using a Win32 Mutex
+- The old implementation which uses runtime adaptation
+depending on the Windows variant being run on. When
+the pthreads DLL was run on Win9x then POSIX mutexes
+would use Win32 Mutexes (because TryEnterCriticalSection
+is not implemented on Win9x).
+
+PTHREAD_MUTEX_DEFAULT
+PTHREAD_MUTEX_NORMAL
+PTHREAD_MUTEX_ERRORCHECK
+PTHREAD_MUTEX_RECURSIVE
+- The current implementation supports these mutex types.
+The underlying basis of POSIX mutexes is now the same
+irrespective of the Windows variant.
+
+
+In all benchtests, the operation is repeated a large
+number of times and an average is calculated. Loop
+overhead is measured and subtracted from all test times.