TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RMI does not give multi-threads



As promised. :-)

I wrote a simple RMI client/server. Here are the details.

The RMI server is a compute engine, it will accept 'tasks' and will
'calculate' the value that the task specifies.

The RMI client will build a 'task' object with the logic to 'calculate' PI to
a user specified number of digits.

I guess you'd run the RMI server on some kick-butt number crunching hardware,
while the RMI client's run on your 486. ;-)

So, start the RMI server on the kick-butt machine. Then I ran the client on 3
seperate machines 'simultaneously'. As fast as I could click. :-)

Client #1, I ask to calculate PI 20,000 digits.
Client #2,  I ask to calculate PI 200 digits.
Client #3, I ask to calculate PI 20 digits.

I run them in this order. And they return in this order. 

To verify the task object has an identifier in it, just a simple number
representing which Client it belongs to.

The RMI server display this when I run the clients.

Processing 1
Done 1
Processing 2
Done 2
Processing 3
Done 3

So, no multi-threading taking place. :-( Just thought I would pass this on.
-- 
Bob Tanner <tanner@real-time.com>       | Phone : (612)943-8700
http://www.real-time.com                | Fax   : (612)943-8500
Key fingerprint =  6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9