Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Multiple thread access to a single remoting object (proxy)

Multiple thread access to a single remoting object (proxy)

Scheduled Pinned Locked Moved .NET (Core and Framework)
question
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    liRetro
    wrote on last edited by
    #1

    Hi, I'm writing a web service that talks to a windows service via remoting. The windows service is configured to remote the object as a singleton. Since multiple web service threads can be spawned by multiple client requests the Remoted object has been written to b thread safe, but what about the web service (client) proxy to the remoted object? Worded another way - I have multiple threads firing methods on a single remoting proxy that is connecting to a singleton object. Will there be any problems with the proxy itself? Here's some psuedo code:

    static RemoteObject remObject; <-- globally stored

    main()
    {
    remObject = GetRemoteConnection(); <-- obtain connection
    ...
    // Create some threads
    ...
    DoSomethingThread1.start();
    DoSomethingThread2.start();
    }

    static void DoSomething()
    {
    remObject.DoSomething(); <-- Will get called by two threads at virtually the same time.
    }

    Thanks in advance for any insights.

    Assert(this);

    L 1 Reply Last reply
    0
    • L liRetro

      Hi, I'm writing a web service that talks to a windows service via remoting. The windows service is configured to remote the object as a singleton. Since multiple web service threads can be spawned by multiple client requests the Remoted object has been written to b thread safe, but what about the web service (client) proxy to the remoted object? Worded another way - I have multiple threads firing methods on a single remoting proxy that is connecting to a singleton object. Will there be any problems with the proxy itself? Here's some psuedo code:

      static RemoteObject remObject; <-- globally stored

      main()
      {
      remObject = GetRemoteConnection(); <-- obtain connection
      ...
      // Create some threads
      ...
      DoSomethingThread1.start();
      DoSomethingThread2.start();
      }

      static void DoSomething()
      {
      remObject.DoSomething(); <-- Will get called by two threads at virtually the same time.
      }

      Thanks in advance for any insights.

      Assert(this);

      L Offline
      L Offline
      liRetro
      wrote on last edited by
      #2

      I answered this question myself. I could not find the information in the MSDN, so I made a test app. that connected to the service. The connections were done from 256 threads that then proceeded to make 50,000 calls at the same time. The server registered these calls and marked the begin and end of each call along with the thread ID. The trace log indicated multiple calls were being executed at the same time with no problems. So the answer seems to be that he remoting proxy is thread safe, and will make multiple calls per connection instance instead of sequencing the calls over one connection. The only other thing I need to do is sniff the wire to see if multiple connections are being made, or if they are getting to the server over one connection. BTW: Anyone know if after a remoting call over a TCP channel if the TCP connection is dropped, or does it stay connected for the life of the proxy?

      Assert(this);

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups