3 Replies Latest reply on Mar 27, 2007 4:41 AM by Ron Sigal

    Concurrent invoke calls

    Jose Luis Newbie

      Hi

      What happens if two threads call the invoke() method (of the class org.jboss.remoting.Client) at the same time.

      What happens if a thread call invoke() while another remote invocation (done by another thread) is in progress.

      is this method thread safe?

      Thanx

        • 1. Re: Concurrent invoke calls
          Ron Sigal Master

          The intention is that Remoting is thread safe from the call to Client.invoke() through the return of a response. In the middle, though, is a call to the ServerInvocationHandler, where thread safety is the responsibility of the application.

          • 2. Re: Concurrent invoke calls
            Jose Luis Newbie

            Oh, thank you very much.

            Then I must take care of the concurrency issues on the server side.

            I must program the SeverInvocationHandler implementation keeping in mind that multiple threads will execute the invoke() method concurrently.

            Is that right?
            Do I have to do anything else?

            But I think that I don't explained my original question clearly.

            I'll try to put it in other words:

            I wanted to know if the Client.invoke() method -in the client side- allows various threads to call concurrently.

            I've made an experiment with two threads calling Client.invoke() -the same Client instance- and the two threads do their call concurrently and happily.

            It's safe and good? is there any problem with this kind of use?

            • 3. Re: Concurrent invoke calls
              Ron Sigal Master

               


              Do I have to do anything else?


              That should be all.


              I wanted to know if the Client.invoke() method -in the client side- allows various threads to call concurrently.


              The Remoting code - client side and server side - is meant to be thread safe.