176
|
1 |
"{ Package: 'exept:regression' }"
|
|
2 |
|
|
3 |
Object subclass:#ManyProcessesTest
|
|
4 |
instanceVariableNames:''
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'AAA'
|
|
8 |
!
|
|
9 |
|
|
10 |
|
|
11 |
!ManyProcessesTest methodsFor:'test'!
|
|
12 |
|
|
13 |
start:count
|
|
14 |
"
|
|
15 |
self start:100
|
|
16 |
"
|
|
17 |
|waitSema|
|
|
18 |
|
|
19 |
waitSema := Semaphore new.
|
|
20 |
waitSema setCount:(1 - count).
|
|
21 |
|
|
22 |
count timesRepeat:[
|
|
23 |
[ [Delay waitForSeconds:0.4.] ensure:[waitSema signal].
|
|
24 |
] forkAt:(Processor userBackgroundPriority)
|
|
25 |
].
|
|
26 |
waitSema wait.
|
|
27 |
Transcript showCR:'done'.
|
|
28 |
!
|
|
29 |
|
|
30 |
test400
|
|
31 |
"
|
|
32 |
self new test400
|
|
33 |
"
|
|
34 |
|waitSema repeat|
|
|
35 |
|
|
36 |
repeat := 4.
|
|
37 |
|
|
38 |
waitSema := Semaphore new.
|
|
39 |
waitSema setCount:(1 - repeat).
|
|
40 |
|
|
41 |
repeat timesRepeat:[
|
|
42 |
[ [self start:100] ensure:[waitSema signal]
|
|
43 |
] forkAt:8.
|
|
44 |
].
|
|
45 |
waitSema wait
|
|
46 |
! !
|
|
47 |
|
|
48 |
!ManyProcessesTest class methodsFor:'documentation'!
|
|
49 |
|
|
50 |
version
|
|
51 |
^ '$Header$'
|
|
52 |
! !
|