summaryrefslogtreecommitdiff
path: root/TAO/DevGuideExamples/Multithreading/ThreadPool/README
blob: fd3533653834b7f9adae79035e602c6098afba7e (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// $Id$

File: DevGuideExamples/Multithreading/ThreadPool/README


This directory contains a CORBA example illustrating a simple client
and a server with an interface Messenger.  This example is based on the
Getting Started example, but adds concurrent request processing
capabilities to the server using the thread pool concurrency model.
The server creates 4 threads for the thread pool.


How to Run 
----------

To start the server :
------------------
./MessengerServer


To start the client:
------------------
./MessengerClient


Tip:
----
Run several clients simultaneously against the server.  Some client
requests should be handled by separate threads in the server.  To
verify this, the server returns the thread ID that handled the request
in the reply message that is printed by the client.  You may see the
same thread used to handle multiple requests, but it is unlikely that
the same thread will be used to handle all of the requests.


Exeuction via Perl Script
-------------------------

A Perl script has been created to automate the steps shown
above.  This script can be run via the following command:

./run_test.pl

Here is sample output from the Perl script:

Starting MessengerServer
IOR written to file Messenger.ior


Starting 9 MessengerClients.
The server should use different threads to handle requests.

Reply: Message handled on thread 1620
Reply: Message handled on thread 1620
Reply: Message handled on thread 1620
Reply: Message handled on thread 1868
Reply: Message handled on thread 1592
Reply: Message handled on thread 1868
Reply: Message handled on thread 1300
Reply: Message handled on thread 1620
Reply: Message handled on thread 1620

NOTE:

  Since the Perl script starts several clients simultaneously, output
  may become garbled since each client writes its output to stdout.

NOTE:

   If you run on Windows platform, go to Debug or Release directory to run the 
   script via following command:  
   
   perl ../run_test.pl