From 663a1af0674c37774d310541e9b30c60316f2055 Mon Sep 17 00:00:00 2001 From: rpj Date: Tue, 3 Jul 2001 02:00:09 +0000 Subject: Cosmetic changes. --- ANNOUNCE | 43 ++++++++++++++++++++++++++----------------- sched.h | 12 +++++++++++- semaphore.c | 7 ++----- tests/Makefile | 3 ++- tests/benchtest4.c | 2 +- tests/exception3.c | 2 +- 6 files changed, 43 insertions(+), 26 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 573d15c..45981a7 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,4 +1,4 @@ - PTHREADS-WIN32 SNAPSHOT 2001-??-?? + PTHREADS-WIN32 SNAPSHOT 2001-07-03 ---------------------------------- Web Site: http://sources.redhat.com/pthreads-win32/ FTP Site: ftp://sources.redhat.com/pub/pthreads-win32 @@ -48,8 +48,8 @@ sched_setscheduler sched_getscheduler ------------------ These routines will require patching to work with UWIN -or any other system that provides it's own pid_t. -Pthread.h conditionally defines pid_t as a DWORD, which +and any other system that provides it's own pid_t. +Our pthread.h conditionally defines pid_t as a DWORD, which is the type returned by GetCurrentProcessId(). The only supported policy is SCHED_OTHER, however, in @@ -116,8 +116,10 @@ Snapshot-2001-06-06 included Thomas Pfaff's enhancements to the mutex routines to improve speed. The improvements are very large on Win9x class systems where pthreads-win32 previously used Win32 mutexes rather than critical -sections as the underlying mechanism. On WNT systems speed -appears to have decreased a little. On Win9x the enhancements +sections as the underlying mechanism. Based on some new +benchtest programs that have been run on a Win98 machine +(and included in the tests directory), WNT systems speed +has probably decreased a little. On Win9x the enhancements also resulted in speed improvements in other primitives which use mutexes internally, such as condition variables and read-write locks. Thomas also added mutex @@ -126,8 +128,8 @@ Specification documentation, and as provided with the majority of major Unix and Linux Pthreads implementations. -Overall, the library provides far more consistent performance -across the different Windows variants with greater compatibility. +Overall, the library now provides far more consistent performance +across the different Windows variants and greater compatibility. Future work will continue to improve on this. New changes: @@ -161,7 +163,7 @@ unlocked or destroyed, an error will ultimately eventuate when the owner thread subsequently attempts to unlock or destroy the mutex. -These mutex changes appear to be consistent with both +These changes appear to be consistent with both the behaviour exhibited by other implementations and their documentation, including the Open Group documentation. @@ -191,9 +193,9 @@ Each test does timings for each of the implemented mutex types and, for reference, also repeats the same tests using the following: -Simple Critical Section -POSIX mutex implemented using a Critical Section -POSIX mutex implemented using a Win32 Mutex +- Simple Critical Section +- POSIX mutex implemented using a Critical Section +- POSIX mutex implemented using a Win32 Mutex The later two represent the old implementation under WNT and W9x respectively. @@ -204,9 +206,10 @@ PTHREAD_MUTEX_NORMAL PTHREAD_MUTEX_ERRORCHECK PTHREAD_MUTEX_RECURSIVE -These tests indicate that is may be worthwhile re-introducing -runtime adaptation of the underlying Win32 synchronisation -mechanism for WinNT. +The results from these tests indicate that is may be +worthwhile re-introducing runtime adaptation of the +underlying Win32 synchronisation mechanism for WinNT +systems. --------- @@ -216,12 +219,18 @@ Pthread_create now sets the priority of the new thread from the value set in the thread attribute. - from Ralf.Brese@pdb4.siemens.de. -A "lost signal" bug in condition variables that I introduced -in the last snapshot has been fixed. +In the last snapshot I introduced a "lost signal" bug into +the condition variables code. - fixed by Alexander Terekhov - reported by Timur Aydin taydin@snet.net +--------- +New tests +--------- +Several new tests have been added to the test suite. + + --------------------------- Known bugs in this snapshot --------------------------- @@ -419,7 +428,7 @@ The following functions are implemented: pthread_attr_setscope (returns an error ENOSYS) sched_get_priority_max (POSIX 1b) sched_get_priority_min (POSIX 1b) - sched_rr_set_interval (POSIX 1b - returns an error ENOSYS) + sched_rr_get_interval (POSIX 1b - returns an error ENOTSUP) sched_setscheduler (POSIX 1b - only supports SCHED_OTHER) sched_getscheduler (POSIX 1b - only supports SCHED_OTHER) sched_yield (POSIX 1b) diff --git a/sched.h b/sched.h index 870087f..23a43cb 100644 --- a/sched.h +++ b/sched.h @@ -66,8 +66,18 @@ int sched_setscheduler (pid_t pid, int policy); int sched_getscheduler (pid_t pid); +/* + * Note that this macro returns ENOTSUP rather than + * ENOSYS as might be expected. However, returning ENOSYS + * should mean that sched_get_priority_{min,max} are + * not implemented as well as sched_rr_get_interval. + * This is not the case, since we just don't support + * round-robin scheduling. Therefore I have chosen to + * return the same value as sched_setscheduler when + * SCHED_RR is passed to it. + */ #define sched_rr_get_interval(_pid, _interval) \ - ( errno = ENOSYS, (int) -1 ) + ( errno = ENOTSUP, (int) -1 ) #ifdef __cplusplus diff --git a/semaphore.c b/semaphore.c index 81b777f..ee9c8f6 100644 --- a/semaphore.c +++ b/semaphore.c @@ -487,7 +487,7 @@ sem_post_multiple (sem_t * sem, int count ) * -1 failed, error in errno * ERRNO * EINVAL 'sem' is not a valid semaphore - * or count is less than zero. + * or count is not greater than zero. * * ------------------------------------------------------ */ @@ -498,10 +498,7 @@ sem_post_multiple (sem_t * sem, int count ) { result = EINVAL; } - else if (count == 0) - { - return 0; - } + else #ifdef NEED_SEM diff --git a/tests/Makefile b/tests/Makefile index 7fd32af..6ac342d 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -60,7 +60,7 @@ PASSES= loadfree.pass \ exception1.pass exception2.pass exception3.pass BENCHRESULTS = \ - benchtest1.pass benchtest2.pass + benchtest1.bench benchtest2.bench benchtest3.bench benchtest4.bench all: @ $(ECHO) Run one of the following command lines: @@ -144,6 +144,7 @@ clean: benchtest1.bench: benchtest2.bench: benchtest3.bench: +benchtest4.bench: cancel1.pass: create1.pass cancel2.pass: cancel1.pass cancel3.pass: context1.pass diff --git a/tests/benchtest4.c b/tests/benchtest4.c index c343db7..8d174a2 100644 --- a/tests/benchtest4.c +++ b/tests/benchtest4.c @@ -77,7 +77,7 @@ main (int argc, char *argv[]) pthread_mutexattr_init(&ma); printf( "========================================================================\n"); - printf( "Non-blocking mutex trylock plus unlock.\n"); + printf( "Trylock plus unlock on an unlocked mutex.\n"); printf( "%ld iterations.\n\n", ITERATIONS); printf( "%-40s %15s %15s\n", "Test", diff --git a/tests/exception3.c b/tests/exception3.c index 216dc27..a343b45 100644 --- a/tests/exception3.c +++ b/tests/exception3.c @@ -1,7 +1,7 @@ /* * File: exception3.c * - * Test Synopsis: Test running of user supplied teerminate() function. + * Test Synopsis: Test running of user supplied terminate() function. * * Test Method (Validation or Falsification): * - -- cgit v1.2.3