The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
This file describes the TLOCKER test program.
TLOCKER.EXE is a Win32 console application that exercises the Locker class.
Double-click on it, and watch the execution.
The test log is placed in TLOCKER.TXT in the current directory.
A progress commentary is displayed on the console.
Tests all Locker functions for LNAME > 64 bytes.
All 4 tests should return RC=-1.
Runs for 20 seconds.
There are 2 "data bases" A & B
Their ADDRESSes are used as the lock name.
6 threads are started, passing a structure containing:
Lock type (FALSE=read only, TRUE=update)
Pointer to Data Base address
(Even numbered threads get B, Odd numbered threads get data base A)
Threads 2 and 5 update their data base using exclusive locks. The data base
value field is incremented on each pass.
Threads 0, 1, 3, and 4 display the current data base value.
There is a 10ms timer delay on all threads except for ODD/update threads, which wait for
500ms. This unbalances the execution against the two data bases, making their respective
values diverge. This simulates a longer code path for one data base update.
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.