• Home
Name Date Size #Lines LOC

..--

BmakefileD12-May-202410.6 KiB355318

ChangeLogD12-May-20241

ChangeLog.2010D12-May-202426.6 KiB919614

ChangeLog.2013D12-May-20240

Debug.dspD12-May-20243.4 KiB9481

Debug.dswD12-May-2024504 3019

Debug.plgD12-May-20241.1 KiB3329

Debug.txtD12-May-2024219 65

GNUmakefileD12-May-202414.6 KiB516416

MakefileD12-May-202414.4 KiB443352

READMED12-May-20241 KiB4527

README.BENCHTESTSD12-May-20242 KiB7555

README.WINPTHREADSD12-May-20242.2 KiB6456

SIZES.GCD12-May-2024561 1716

SIZES.GCED12-May-2024744 2221

SIZES.VCD12-May-2024673 2119

SIZES.VCED12-May-2024672 2019

SIZES.VSED12-May-2024672 2019

WmakefileD12-May-202410.8 KiB350312

barrier1.cD12-May-20241.8 KiB5912

barrier2.cD12-May-20241.8 KiB5610

barrier3.cD12-May-20242.3 KiB7827

barrier4.cD12-May-20242.8 KiB11154

barrier5.cD12-May-20243.3 KiB12163

barrier6.cD12-May-20243.1 KiB11859

benchlib.cD12-May-20246.9 KiB362258

benchtest.hD12-May-20242.3 KiB6925

benchtest1.cD12-May-20247 KiB250137

benchtest2.cD12-May-20248.8 KiB312216

benchtest3.cD12-May-20245.8 KiB202110

benchtest4.cD12-May-20245.3 KiB18396

benchtest5.cD12-May-20244.4 KiB16073

cancel1.cD12-May-20244.4 KiB18165

cancel2.cD12-May-20245.4 KiB252119

cancel3.cD12-May-20244.8 KiB20375

cancel4.cD12-May-20244.6 KiB20573

cancel5.cD12-May-20244.6 KiB20073

cancel6a.cD12-May-20244.2 KiB19374

cancel6d.cD12-May-20244.1 KiB19277

cancel7.cD12-May-20244.6 KiB20382

cancel8.cD12-May-20242.6 KiB13182

cancel9.cD12-May-20245.1 KiB20395

cleanup0.cD12-May-20244.9 KiB230100

cleanup1.cD12-May-20245.2 KiB243107

cleanup2.cD12-May-20244.6 KiB21896

cleanup3.cD12-May-20244.7 KiB22399

condvar1.cD12-May-20242.5 KiB9812

condvar1_1.cD12-May-20242.9 KiB11630

condvar1_2.cD12-May-20243.1 KiB12537

condvar2.cD12-May-20243.3 KiB12736

condvar2_1.cD12-May-20241.6 KiB8158

condvar3.cD12-May-20241.4 KiB7147

condvar3_1.cD12-May-20244.8 KiB19187

condvar3_2.cD12-May-20244.6 KiB18470

condvar3_3.cD12-May-20243.5 KiB13328

condvar4.cD12-May-20241.9 KiB9561

condvar5.cD12-May-20241.9 KiB9561

condvar6.cD12-May-20243.1 KiB17295

condvar7.cD12-May-20243.7 KiB196110

condvar8.cD12-May-20243.5 KiB188110

condvar9.cD12-May-20244 KiB196117

context1.cD12-May-20241,005 7346

count1.cD12-May-20242.5 KiB9130

create1.cD12-May-20241.9 KiB6716

create2.cD12-May-20242.6 KiB10928

create3.cD12-May-20242.7 KiB12433

delay1.cD12-May-20241.7 KiB528

delay2.cD12-May-20242.3 KiB8331

detach1.cD12-May-20242.5 KiB9433

equal1.cD12-May-20242 KiB6717

errno1.cD12-May-20243.7 KiB17960

exception1.cD12-May-20245.9 KiB264119

exception2.cD12-May-20243.4 KiB15955

exception3.cD12-May-20244.1 KiB18170

exit1.cD12-May-20241.7 KiB518

exit2.cD12-May-20241.8 KiB6516

exit3.cD12-May-2024381 3120

exit4.cD12-May-20244.2 KiB18669

exit5.cD12-May-20244.4 KiB19273

eyal1.cD12-May-20248.5 KiB368195

inherit1.cD12-May-20243.1 KiB10880

join0.cD12-May-20242 KiB6818

join1.cD12-May-20242.2 KiB7927

join2.cD12-May-2024471 3224

join3.cD12-May-20242.2 KiB7625

kill1.cD12-May-20242.1 KiB847

loadfree.cD12-May-20242.6 KiB716

mutex1.cD12-May-20242.1 KiB6914

mutex1e.cD12-May-20242.3 KiB7517

mutex1n.cD12-May-20242.3 KiB7517

mutex1r.cD12-May-20242.3 KiB7517

mutex2.cD12-May-20242.2 KiB7118

mutex2e.cD12-May-20242 KiB6714

mutex2r.cD12-May-20242 KiB6714

mutex3.cD12-May-20242.1 KiB7620

mutex3e.cD12-May-20242.1 KiB7620

mutex3r.cD12-May-20242.1 KiB7620

mutex4.cD12-May-20243.7 KiB11757

mutex5.cD12-May-20242.4 KiB6820

mutex6.cD12-May-20242.6 KiB9527

mutex6e.cD12-May-20243 KiB10334

mutex6es.cD12-May-20242.7 KiB9527

mutex6n.cD12-May-20242.9 KiB10532

mutex6r.cD12-May-20242.9 KiB10134

mutex6rs.cD12-May-20242.7 KiB9327

mutex6s.cD12-May-20242.5 KiB9426

mutex7.cD12-May-20242.4 KiB8324

mutex7e.cD12-May-20243 KiB10334

mutex7n.cD12-May-20242.7 KiB9430

mutex7r.cD12-May-20243 KiB10134

mutex8.cD12-May-20242 KiB8329

mutex8e.cD12-May-20242.5 KiB9835

mutex8n.cD12-May-20242.5 KiB9835

mutex8r.cD12-May-20242.5 KiB9835

once1.cD12-May-20242 KiB7824

once2.cD12-May-20243.3 KiB12364

once3.cD12-May-20244.1 KiB14061

once4.cD12-May-20245.9 KiB207109

priority1.cD12-May-20244.7 KiB17372

priority2.cD12-May-20244.8 KiB17172

reuse1.cD12-May-20241.1 KiB5342

reuse2.cD12-May-20241.8 KiB8961

runall.cD12-May-20241.8 KiB6860

rwlock1.cD12-May-20241.9 KiB6212

rwlock2.cD12-May-20242 KiB6714

rwlock2_t.cD12-May-20242.3 KiB7922

rwlock3.cD12-May-20242.1 KiB7720

rwlock3_t.cD12-May-20242.4 KiB8828

rwlock4.cD12-May-20242.1 KiB7720

rwlock4_t.cD12-May-20242.4 KiB8828

rwlock5.cD12-May-20242.2 KiB7921

rwlock5_t.cD12-May-20242.5 KiB9029

rwlock6.cD12-May-20242.9 KiB10345

rwlock6_t.cD12-May-20243.5 KiB12765

rwlock6_t2.cD12-May-20243.3 KiB12059

rwlock7.cD12-May-20244.6 KiB200128

rwlock8.cD12-May-20244.8 KiB209130

self1.cD12-May-2024145 128

self2.cD12-May-20241.9 KiB7418

semaphore1.cD12-May-20243.4 KiB16267

semaphore2.cD12-May-20242.6 KiB10925

semaphore3.cD12-May-20243 KiB12237

semaphore4.cD12-May-20243.5 KiB14149

semaphore4t.cD12-May-20243.3 KiB13344

semaphore5.cD12-May-20242.4 KiB10419

sizes.cD12-May-20241.5 KiB3124

spin1.cD12-May-20241.9 KiB6012

spin2.cD12-May-20242.1 KiB7622

spin3.cD12-May-20242.2 KiB7325

spin4.cD12-May-20242.8 KiB10448

stress1.cD12-May-20247.1 KiB279143

test.hD12-May-20244.8 KiB183116

tryentercs.cD12-May-20243 KiB10439

tryentercs2.cD12-May-20242.8 KiB9430

tsd1.cD12-May-20245 KiB21278

tsd2.cD12-May-20245.1 KiB21681

valid1.cD12-May-20242.4 KiB10424

valid2.cD12-May-20242.2 KiB858

README

1Running test cases in this directory
2------------------------------------
3
4These make scripts expect to be able to copy the dll, library
5and header files from this directory's parent directory,
6which should be the pthreads-win32 source directory.
7
8MS VC nmake
9-------------
10
11Run the target corresponding to the DLL version being tested:
12
13nmake clean VC
14
15or:
16
17nmake clean VS
18
19
20GNU GCC make
21------------
22
23Run "make clean" and then "make". See the "Known bugs" section
24in ..\README.
25
26
27Writing Test Cases
28------------------
29
30Tests written in this test suite should behave in the following manner:
31
32	* If a test fails, leave main() with a result of 1.
33
34	* If a test succeeds, leave main() with a result of 0.
35
36	* No diagnostic output should appear when the test is succeeding.
37	  Diagnostic output may be emitted if something in the test
38	  fails, to help determine the cause of the test failure.
39
40Notes:
41------
42
43Many test cases use knowledge of implementation internals which are supposed
44to be opaque to portable applications.
45

README.BENCHTESTS

1
2------------
3Benchmarking
4------------
5There is a set a benchmarking programs in the
6"tests" directory. These should be runnable using the
7following command-lines corresponding to each of the possible
8library builds:
9
10MSVC:
11nmake clean VC-bench
12nmake clean VCE-bench
13nmake clean VSE-bench
14
15Mingw32:
16make clean GC-bench
17make clean GCE-bench
18
19UWIN:
20The benchtests are run as part of the testsuite.
21
22
23Mutex benchtests
24----------------
25
26benchtest1 - Lock plus unlock on an unlocked mutex.
27benchtest2 - Lock plus unlock on a locked mutex.
28benchtest3 - Trylock on a locked mutex.
29benchtest4 - Trylock plus unlock on an unlocked mutex.
30
31
32Each test times up to three alternate synchronisation
33implementations as a reference, and then times each of
34the four mutex types provided by the library. Each is
35described below:
36
37Simple Critical Section
38- uses a simple Win32 critical section. There is no
39additional overhead for this case as there is in the
40remaining cases.
41
42POSIX mutex implemented using a Critical Section
43- The old implementation which uses runtime adaptation
44depending on the Windows variant being run on. When
45the pthreads DLL was run on WinNT or higher then
46POSIX mutexes would use Win32 Critical Sections.
47
48POSIX mutex implemented using a Win32 Mutex
49- The old implementation which uses runtime adaptation
50depending on the Windows variant being run on. When
51the pthreads DLL was run on Win9x then POSIX mutexes
52would use Win32 Mutexes (because TryEnterCriticalSection
53is not implemented on Win9x).
54
55PTHREAD_MUTEX_DEFAULT
56PTHREAD_MUTEX_NORMAL
57PTHREAD_MUTEX_ERRORCHECK
58PTHREAD_MUTEX_RECURSIVE
59- The current implementation supports these mutex types.
60The underlying basis of POSIX mutexes is now the same
61irrespective of the Windows variant, and should therefore
62have consistent performance.
63
64
65Semaphore benchtests
66--------------------
67
68benchtest5 - Timing for various uncontended cases.
69
70
71In all benchtests, the operation is repeated a large
72number of times and an average is calculated. Loop
73overhead is measured and subtracted from all test times.
74
75

README.WINPTHREADS

1
2-------------------------------------
3Using the test suite for winpthreads
4-------------------------------------
5
6This test suite is originally designed for testing compliance: it just says when the tests pass without any further information.
7Because this is inconvenient for work in progress, the behaviour has been modified to show more information for debugging while keeping the changes minimal
8(for syncing purposes)
9
10Procedure:
11----------
12
131. Enter the winpthreads dir:
14   $ cd winpthreads
152. Build the winpthreads lib
16   $ make
173. Make a copy for the test-suite:
18   $ cp libpthread.a libpthreadGC2.a
194. Enter the test-suite dir:
20   $ cd tests
215. (optional) Clean:
22   $ make clean
236. Build the suite. This will also run the tests. A few might crash so you have to click a dialog away.
24   The tool "runall.exe" will also be built.
25   $ make GC-static
26   To log both the compile results and the asserts:
27   $ make GC-static 2> compile-errors.log
287. Now you have a bunch of .exe and maybe some .pass files. Remove the .pass files. They don't contain much useful yet.
29   $ rm *.pass
308. Re-run the tests in debugging mode. Again some crash dialogs maybe.
31   runall will skip files with already an .pass or .fail output.
32   $ runall .
339. Now 3 types of files will be generated for each source (.c) file (runall excludes itself):
34   The stderr output with the asserts will be logged to corresponding .fail
35   and .pass files.
36   - .pass : the test has passed (exited with 0).
37   - .fail : the test has failed (exited with != 0).
38   - .x : no .exe found. Probably the compile has failed.
39   Note that when a test crashes, a .fail output will be generated, even without failed asserts.
40
41Module testing:
42---------------
43
44Sometimes you want to test, debug and modify a single test, say once2.c:
451. Copy test.h to the debug test dir:
46   $ cp test.h ../test
472. Copy the file to the debug test dir:
48   $ cp once2.c ../test
493. Enter the debug test dir:
50   $ cd ../test
514. Build and run it:
52   $ make once2.exe
53   $ ./once2.exe
54
55Benchtests:
56-----------
57
58These work, but you have to compile them by hand like this:
59$ make benchlib.o
60$ make benchtest1.exe
61$ make benchtest2.exe
62$ make benchtest3.exe
63$ make benchtest4.exe
64$ make benchtest5.exe