Hi
I have a problem.
Let's say I have a method "public int foo()" on a remote object, and I want to enable multiple invocations of that method my multiple clients.
My Idea was assigning a new Thread each the method is invoked and letting the thread handle it.
like this:
public int foo()
{
new MyThread().start();
}
public class MyThread extends Thread
{
..
public void run()
{
...(code for method)
}
}
my problem is, how do I return the value of the method from the thread ? I don't want to wait in the method until the Thread finishes, because then I might as well not used a Thread. is there a way to do that ?
Thanx.
I have a problem.
Let's say I have a method "public int foo()" on a remote object, and I want to enable multiple invocations of that method my multiple clients.
My Idea was assigning a new Thread each the method is invoked and letting the thread handle it.
like this:
public int foo()
{
new MyThread().start();
}
public class MyThread extends Thread
{
..
public void run()
{
...(code for method)
}
}
my problem is, how do I return the value of the method from the thread ? I don't want to wait in the method until the Thread finishes, because then I might as well not used a Thread. is there a way to do that ?
Thanx.