@@ -45,7 +45,6 @@ assert. remote_stuff=3
45
45
)
46
46
47
47
f =: 3 : 0
48
- chk=. (' FreeBSD' -: UNAME)
49
48
granularity=. 2e_13
50
49
try.
51
50
while. 2 > 1 T. ' ' do. 0 T. ' ' end. NB. make sure we have 2 worker threads
@@ -58,9 +57,9 @@ assert. 2 <: 1 T. ''
58
57
NB. verify that tasks go to different threads if possible. We can ensure this only for as many threads as there are cores
59
58
setth nwthreads=. 1 >. <: 0 { 8 T. ' ' NB. one worker thread per core, -1
60
59
wthr nwthreads
61
- assert. (0 [ GITHUBCI) +. ( >: i. nwthreads) *. / @ e. aaa__ =: > (3 & T. @ ' ' )@ (6 !: 3 ) t. ' ' " (0 ) (0.1 # ~ <: nwthreads), 0.6
60
+ assert. (>: i. nwthreads) *. / @ e. aaa__ =: > (3 & T. @ ' ' )@ (6 !: 3 ) t. ' ' " (0 ) (0.1 # ~ <: nwthreads), 0.6
62
61
wthr nwthreads
63
- assert. (0 [ GITHUBCI) +. ( >: i. nwthreads) *. / @ e. > (3 & T. @ ' ' )@ (6 !: 3 ) t. ' ' " (0 ) (0.6 # ~ <: nwthreads), 0.1
62
+ assert. (>: i. nwthreads) *. / @ e. > (3 & T. @ ' ' )@ (6 !: 3 ) t. ' ' " (0 ) (0.6 # ~ <: nwthreads), 0.1
64
63
wthr nwthreads
65
64
assert. (ccc__ =: ((< _1000 ) # ~ <: nwthreads), (>: i. nwthreads); _1001 ) e. ~ & > bbb__ =: 4 T. aaa__ =: (3 & T. @ ' ' )@ (6 !: 3 ) t. ' ' " (0 ) (0.3 # ~ <: nwthreads), 2 1 NB. last thread should run in master; earlier ones complete first
66
65
wthr nwthreads
@@ -72,38 +71,30 @@ pyx =. 6!:3 t. ''"0 N # 1.0 NB. fill up with delaying threads
72
71
NB. Verify forcetask arg
73
72
t0 =. 6 !: 1 ' '
74
73
assert. 1. = > pyx
75
- techo^: chk ' gtdot3 a13'
76
74
NB. Verify forcetask arg
77
75
NB. assert. (t0 + 0.5) < 6!:1'' [ 'a1' NB. master should not wait
78
- techo^: chk ' gtdot3 a13a'
79
76
wthr nwthreads
80
- techo^: chk ' gtdot3 a13b'
81
77
pyx =. 6 !: 3 t. ' ' " 0 (>: N) # 1.0 NB. fill up with delaying threads
82
- techo^: chk ' gtdot3 a13c'
83
78
t0 =. 6 !: 1 ' '
84
79
assert. 1. = > pyx
85
80
NB. assert. (t0 + 0.5) > 6!:1'' [ 'a2' NB. master should wait
86
81
wthr nwthreads
87
82
pyx =. 6 !: 3 t. ' worker' " 0 (>: N) # 1.0 NB. fill up with delaying threads
88
- techo^: chk ' gtdot3 a13d'
89
83
t0 =. 6 !: 1 ' '
90
84
assert. 1. = > pyx
91
85
NB. assert. (t0 + 0.5) < 6!:1'' [ 'a3' NB. master should not wait
92
86
wthr nwthreads
93
87
pyx =. 6 !: 3 t. (< ' worker' ) " 0 (>: N) # 1.0 NB. fill up with delaying threads
94
- techo^: chk ' gtdot3 a13e'
95
88
t0 =. 6 !: 1 ' '
96
89
assert. 1. = > pyx
97
90
NB. assert. (t0 + 0.5) < 6!:1'' [ 'a4' NB. master should not wait
98
91
wthr nwthreads
99
92
pyx =. 6 !: 3 t. (< ' worker' ; 1 ) " 0 (>: N) # 1.0 NB. fill up with delaying threads
100
- techo^: chk ' gtdot3 a13f'
101
93
t0 =. 6 !: 1 ' '
102
94
assert. 1. = > pyx
103
95
NB. assert. (t0 + 0.5) < 6!:1'' [ 'a5' NB. master should not wait
104
96
wthr nwthreads
105
97
pyx =. 6 !: 3 t. (< ' worker' ; 0 ) " 0 (>: N) # 1.0 NB. fill up with delaying threads
106
- techo^: chk ' gtdot3 a13g'
107
98
t0 =. 6 !: 1 ' '
108
99
1. = > pyx
109
100
NB. assert. (t0 + 0.5) > 6!:1'' [ 'a6' NB. master should wait
@@ -123,22 +114,17 @@ mtx =. 10 T. 0
123
114
assert. 0 = 11 T. mtx
124
115
' domain error' -: 11 T. etx >: &. > mtx
125
116
mtx =. 10 T. 0
126
- techo^: chk ' gtdot3 a32'
127
117
tod =. 6 !: 1 ' '
128
- techo^: chk ' gtdot3 a32a'
129
118
assert. 0 = > {{11 T. y }}t. ' ' mtx NB. boxed mtx OK
130
- techo^: chk ' gtdot3 a32b'
131
119
NB. the following line hang on freebsd
132
120
assert. 1 = 11 T. mtx; 2.0
133
- techo^: chk ' gtdot3 a32c'
134
- assert. (0 [ GITHUBCI) +. (2.3 > dly) *. (2 - granularity) <: dly =. tod- ~ 6 !: 1 ' ' NB. verify delay
135
- techo^: chk ' gtdot3 a32d'
121
+ assert. (2.3 > dly) *. (2 - granularity) <: dly =. tod- ~ 6 !: 1 ' ' NB. verify delay
136
122
tod =. 6 !: 1 ' '
137
123
assert. 1 = 11 T. mtx; 0.1
138
- assert. (0 [ GITHUBCI) +. ( 0 .3 > dly) *. (0.1 - granularity) <: dly =. tod- ~ 6 !: 1 ' ' NB. verify delay
124
+ assert. (0.3 > dly) *. (0.1 - granularity) <: dly =. tod- ~ 6 !: 1 ' ' NB. verify delay
139
125
tod =. 6 !: 1 ' '
140
126
assert. 1 = 11 T. mtx; 0
141
- assert. (0 [ GITHUBCI) +. ( 0 .3 > dly) *. 0 <: dly =. tod- ~ 6 !: 1 ' ' NB. verify no delay
127
+ assert. (0.3 > dly) *. 0 <: dly =. tod- ~ 6 !: 1 ' ' NB. verify no delay
142
128
mtx=.10 T. 1 NB. recursive
143
129
assert. 0 = 11 T. mtx
144
130
assert. 0 = 11 T. mtx NB. lock count=2
0 commit comments