blob: ee02bff879df2412cba741450ff7654996b9865b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
$Id$
Description:
This is a test for collocation when using thread pools and lanes.
There are multiple servants in this test:
(a) One servant is in the Root POA which is service by the default
thread pool.
(b) Another servant is in a POA which is serviced by a thread pool
without lanes. Since a thread pool without lanes is really a
thread pool with one lane, all requests will be handled by this
one lane. Therefore, setting the priority model policy was not
necessary for this POA.
(c) There are two servants is in a POA which is serviced by a thread
pool with lanes, with the CLIENT_PROPAGATED policy. Depending on
the priority of the caller, either one of the lanes processes the
request.
(d) There are two more servants is in a POA which is serviced by a
thread pool with lanes, with the SERVER_DECLARED policy. One
servant is registered to match one lane and the other servant
matches the other lane.
All six servants are put into a global array. The main thread starts
off the testing by calling start() on each servant in the array. The
implementation of start() calls method() on each servant in the array.
Since the upcalls will be handled by the lane corresponding to each
servant, all six lanes ends up calling into one another.
The main thread then changes its priority and calls start() on each
servant in the array. This makes sure to exercise the second lane in
the thread pool with lanes and the CLIENT_PROPAGATED priority.
The test also converts the objects into strings and back to make sure
that collocation works as expected for imported objects.
This test has enough asserts to make sure that the correct thread is
making the upcall.
|