Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tests/benchmarks.
|
|
* pthread_mutex_trylock.c: Should return EBUSY rather than EDEADLK.
* pthread_mutex_destroy.c: Remove redundant ownership test (the
trylock call does this for us); do not destroy a recursively locked
mutex.
|
|
|
|
|
|
* pthread.h: Conditionally added some #defines from config.h
needed when not building the library. e.g. NEED_ERRNO, NEED_SEM.
(PTW32_DLLPORT): Now only defined if _DLL defined.
(_errno): Compiler directive was incorrectly including prototype.
* sched.h: Conditionally added some #defines from config.h
needed when not building the library.
* semaphore.h: Replace an instance of NEED_SEM that should
have been NEED_ERRNO. This change currently has nil effect.
* GNUmakefile: Correct some recent changes.
* Makefile: Add rule to generate pre-processor output.
|
|
exit() rather than pthread_exit(). Add comments to explain
why.
* rwlock2_t.c: New test.
* rwlock3_t.c: New test.
* rwlock4_t.c: New test.
* rwlock5_t.c: New test.
* rwlock6_t.c: New test.
* rwlock6_t2.c: New test.
* rwlock6.c (main): Swap thread and result variables
to correspond to actual thread functions.
* rwlock1.c: Change test description comment to correspond
to the actual test.
|
|
critical section to solve deadlock problem.
* pthread.c: Add all remaining C modules.
* pthread.h: Use dllexport/dllimport attributes on functions
to avoid using pthread.def.
* sched.h: Likewise.
* semaphore.h: Likewise.
* GNUmakefile: Add new targets for single translation
unit build to maximise inlining potential; generate
pthread.def automatically.
* Makefile: Likewise, but no longer uses pthread.def.
|
|
|
|
|
|
to disable cancelation at the start of a thread's cancelation
run to prevent double cancelation. The main problem
arises if a thread is canceling and then receives a subsequent
async cancel request.
* private.c: Likewise.
* condvar.c: Place pragmas around cleanup_push/pop to turn
off inline optimisation (/Obn where n>0 - MSVC only). Various
optimisation switches in MSVC turn this on, which interferes with
the way that cleanup handlers are run in C++ EH and SEH
code. Application code compiled with inline optimisation must
also wrap cleanup_push/pop blocks with the pragmas, e.g.
#pragma inline_depth(0)
pthread_cleanup_push(...)
...
pthread_cleanup_pop(...)
#pragma inline_depth(8)
* rwlock.c: Likewise.
* mutex.c: Remove attempts to inline some functions.
* signal.c: Modify misleading comment.
tests/
* mutex8: New test.
* mutex8n: New test.
* mutex8e: New test.
* mutex8r: New test.
* cancel6a: New test.
* cancel6d: New test.
* cleanup0.c: Add pragmas for inline optimisation control.
* cleanup1.c: Add pragmas for inline optimisation control.
* cleanup2.c: Add pragmas for inline optimisation control.
* cleanup3.c: Add pragmas for inline optimisation control.
* condvar7.c: Add pragmas for inline optimisation control.
* condvar8.c: Add pragmas for inline optimisation control.
* condvar9.c: Add pragmas for inline optimisation control.
|
|
* mutex.c (pthread_mutex_timedlock): New function suggested by
Alexander Terekhov. The logic required to implement this
properly came from Alexander, with some collaboration
with Thomas Pfaff.
(pthread_mutex_unlock): Wrap the waiters check and sema
post in a critical section to prevent a race with
pthread_mutex_timedlock.
(ptw32_timed_semwait): New function;
returns a special result if the absolute timeout parameter
represents a time already passed when called; used by
pthread_mutex_timedwait(). Have deliberately not reused
the name "ptw32_sem_timedwait" because they are not the same
routine.
* condvar.c (ptw32_cond_timedwait): Use the new sem_timedwait()
instead of ptw32_sem_timedwait(), which now has a different
function. See previous.
* implement.h: Remove prototype for ptw32_sem_timedwait.
See next.
(pthread_mutex_t_): Add critical section element for access
to lock_idx during mutex post-timeout processing.
* semaphore.h (sem_timedwait): See next.
* semaphore.c (sem_timedwait): See next.
* private.c (ptw32_sem_timedwait): Move to semaphore.c
and rename as sem_timedwait().
2002-01-18 Ross Johnson <rpj@special.ise.canberra.edu.au>
* sync.c (pthread_join): Was getting the exit code from the
calling thread rather than the joined thread if
defined(__MINGW32__) && !defined(__MSVCRT__).
2002-01-15 Ross Johnson <rpj@special.ise.canberra.edu.au>
* pthread.h: Unless the build explicitly defines __CLEANUP_SEH,
__CLEANUP_CXX, or __CLEANUP_C, then the build defaults to
__CLEANUP_C style cleanup. This style uses setjmp/longjmp
in the cancelation and thread exit implementations and therefore
won't do stack unwinding if linked to applications that have it
(e.g. C++ apps). This is currently consistent with most/all
commercial Unix POSIX threads implementations.
* spin.c (pthread_spin_init): Edit renamed function call.
* nonportable.c (pthread_num_processors_np): New.
(pthread_getprocessors_np): Renamed to ptw32_getprocessors
and moved to private.c.
* private.c (pthread_getprocessors): Moved here from
nonportable.c.
* pthread.def (pthread_getprocessors_np): Removed
from export list.
* rwlock.c (pthread_rwlockattr_init): New.
(pthread_rwlockattr_destroy): New.
(pthread_rwlockattr_getpshared): New.
(pthread_rwlockattr_setpshared): New.
|
|
indirection error introduced 2002-01-04.
(pthread_attr_getscope): Likewise.
* pthread.dsp (SOURCE): Add missing source files.
./tests/:
* exception3.c (main): Shorten wait time.
* mutex7.c: New test.
* mutex7n.c: New test.
* mutex7e.c: New test.
* mutex7r.c: New test.
* mutex6.c: Modified to avoid leaving the locked mutex
around on exit.
|
|
WSAGetLastError() and WSASetLastError().
* Makefile (wsock32.lib): Likewise.
* create.c: Minor mostly inert changes.
* implement.h (PTW32_MAX): Move into here and renamed
from sched.h.
(PTW32_MIN): Likewise.
* GNUmakefile (TEST_ICE): Define if testing internal
implementation of InterlockedCompareExchange.
* Makefile (TEST_ICE): Likewise.
* private.c (TEST_ICE): Likewise.
|
|
|
|
* barrier.c: Fix several bugs in all routines. Now passes
tests/barrier5.c which is fairly rigorous. There is still
a non-optimal work-around for a race condition between
the barrier breeched event signal and event wait. Basically
the last (signalling) thread to hit the barrier yields
to allow any other threads, which may have lost the race,
to complete.
tests/ChangeLog:
* barrier3.c: Fixed.
* barrier4.c: Fixed.
* barrier5.c: New; proves that all threads in the group
reaching the barrier wait and then resume together. Repeats
the test using groups of 1 to 16 threads. Each group of
threads must negotiate a large number of barriers (10000).
* spin4.c: Fixed.
* test.h (error_string): Modified the success (0) value.
|
|
* spin.c: Revamped and working; included static initialiser.
* barrier.c: Likewise.
* condvar.c: Macro constant change; inline auto init routine.
* mutex.c: Likewise.
* rwlock.c: Likewise.
* private.c: Add support for spinlock initialiser.
* global.c: Likewise.
* implement.h: Likewise.
* pthread.h (PTHREAD_SPINLOCK_INITIALIZER): Fix typo.
tests/ChangeLog:
* spin3.c: Changed test and fixed.
* spin4.c: Fixed.
* barrier3.c: Fixed.
* barrier4.c: Fixed.
|
|
for this object.
* pthread.h (PTHREAD_BARRIER_INITIALIZER): Removed.
* rwlock.c (pthread_rwlock_wrlock): This routine is
not a cancelation point - disable deferred
cancelation around call to pthread_cond_wait().
tests/ChangeLog:
* spin1.c: New; testing spinlocks.
* spin2.c: New; testing spinlocks.
* spin3.c: New; testing spinlocks.
* spin4.c: New; testing spinlocks.
* barrier1.c: New; testing barriers.
* barrier2.c: New; testing barriers.
* barrier3.c: New; testing barriers.
* barrier4.c: New; testing barriers.
* GNUmakefile: Add new tests.
* Makefile: Add new tests.
|
|
Contributed by - Alexander Terekhov.
* condvar.c: Fixed lost signal bug reported by Timur Aydin
(taydin@snet.net).
[RPJ (me) didn't translate the original algorithm
correctly.]
* semaphore.c: Added sem_post_multiple; this is a useful
routine, but it doesn't appear to be standard. For now it's
not an exported function.
tests/ChangeLog:
2001-07-01 Ross Johnson <rpj@special.ise.canberra.edu.au>
* benchtest3.c: New; timing mutexes.
* benchtest4.c: New; time mutexes.
* condvar3_1.c: Fixed bug - Alexander Terekhov
* condvar3_3.c: New test.
2001-06-25 Ross Johnson <rpj@special.ise.canberra.edu.au>
* priority1.c: New test.
* priority2.c: New test.
* inherit1.c: New test.
* benchtest1.c: New; timing mutexes.
* benchtest2.c: New; timing mutexes.
* mutex4.c: Modified to test all mutex types.
|
|
* create.c (pthread_create): Add priority inheritance
attributes.
* mutex.c (pthread_mutex_lock): Remove some overhead for
PTHREAD_MUTEX_NORMAL mutex types. Specifically, avoid
calling pthread_self() and pthread_equal() to check/set
the mutex owner. Introduce a new pseudo owner for this
type. Test results suggest increases in speed of up to
90% for non-blocking locks.
This is the default type of mutex used internally by other
synchronising objects, ie. condition variables and
read-write locks. The test rwlock7.c shows about a
30-35% speed increase over snapshot 2001-06-06. The
price of this is that the application developer
must ensure correct behaviour, or explicitly set the
mutex to a safer type such as PTHREAD_MUTEX_ERRORCHECK.
For example, PTHREAD_MUTEX_NORMAL (or PTHREAD_MUTEX_DEFAULT)
type mutexes will not return an error if a thread which is not
the owner calls pthread_mutex_unlock. The call will succeed
in unlocking the mutex if it is currently locked, but a
subsequent unlock by the true owner will then fail with EPERM.
This is however consistent with some other implementations.
(pthread_mutex_unlock): Likewise.
(pthread_mutex_trylock): Likewise.
(pthread_mutex_destroy): Likewise.
* attr.c (pthread_attr_init): PTHREAD_EXPLICIT_SCHED is the
default inheritance attribute; THREAD_PRIORITY_NORMAL is
the default priority for new threads.
* sched.c (pthread_attr_setschedpolicy): Added routine.
(pthread_attr_getschedpolicy): Added routine.
(pthread_attr_setinheritsched): Added routine.
(pthread_attr_getinheritsched): Added routine.
* pthread.h (sched_rr_set_interval): Added as a macro;
returns -1 with errno set to ENOSYS.
2001-06-23 Ross Johnson <rpj@setup1.ise.canberra.edu.au>
*sched.c (pthread_attr_setschedparam): Add priority range
check.
(sched_setscheduler): New function; checks for a valid
pid and policy; checks for permission to set information
in the target process; expects pid to be a Win32 process ID,
not a process handle; the only scheduler policy allowed is
SCHED_OTHER.
(sched_getscheduler): Likewise, but checks for permission
to query.
* pthread.h (SCHED_*): Moved to sched.h as defined in the
POSIX standard.
* sched.h (SCHED_*): Moved from pthread.h.
(pid_t): Defined if necessary.
(sched_setscheduler): Defined.
(sched_getscheduler): Defined.
* pthread.def (sched_setscheduler): Exported.
(sched_getscheduler): Likewise.
2001-06-23 Ross Johnson <rpj@setup1.ise.canberra.edu.au>
Contributed by - Ralf Brese <Ralf.Brese@pdb4.siemens.de>
* create.c (pthread_create): Set thread priority from
thread attributes.
|