TCLUG Development Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TCLUG-DEVEL:167] RMI does not give multi-threads
Bob Tanner wrote:
>
> 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
>
I think you would have to build your own multi-threaded RMI Server.
Accept a request coming in on 1099, pull a thread from your pool, assign
your compute task to that thread, and return to a wait state until the
next request comes in.
--
Perry Hoekstra
Talent Software Services
dutchman@mn.uswest.net
"I don't see much sense in that," said Rabbit.
"No," said Pooh humbly, "there isn't. But there was going to be when I
began it. It's just that something happened to it along the way."