1
# See the file LICENSE for redistribution information.
3
# Copyright (c) 1996-2002
4
# Sleepycat Software. All rights reserved.
10
# TEST Generate a bunch of parallel testers that try to randomly obtain locks.
19
puts "Mutex003: Multi-process random mutex test"
23
puts "\tMutex003.a: Create environment"
24
# Now open the region we'll use for multiprocess testing.
25
set env [berkdb_env -create -mode 0644 -lock -home $testdir]
26
error_check_good env_open [is_valid_env $env] TRUE
28
set mutex [$env mutex 0644 $nmutex]
29
error_check_good mutex_init [is_valid_mutex $mutex $env] TRUE
31
error_check_good mutex_close [$mutex close] 0
33
# Now spawn off processes
34
puts "\tMutex003.b: Create $procs processes"
36
for { set i 0 } {$i < $procs} {incr i} {
38
$test_path/mutexscript.tcl $testdir\
39
$iter $nmutex $wait $mdegree > $testdir/$i.mutexout &"
40
set p [exec $tclsh_path $test_path/wrap.tcl \
41
mutexscript.tcl $testdir/$i.mutexout $testdir\
42
$iter $nmutex $wait $mdegree &]
45
puts "\tMutex003.c: $procs independent processes now running"
47
error_check_good env_close [$env close] 0
49
for { set i 0 } {$i < $procs} {incr i} {
50
fileremove -f $testdir/$i.mutexout