Home Help Center

Odd threading issue

keckrlkeckrl Member Robert KeckOrganization: University of RochesterProject: Distributed device control system
ICE 3.5.1, C# (VS 2013), Windows 7 x64.

I have a C# ICE client and server where the server performs time consuming (2 second timed wait for my demo) operations for the client. The client requests the operations in parallel (Parallel.For) and both client and server have thread pools large enough to accommodate all the requests outstanding at once. My code is based on the BiDir example, but no callbacks are being used when the issue is observed. Both client and server are running on the same machine.

If "Ice.Trace.Protocol=1" is set on either the client or the server, I get the expected behavior and the operations proceed in complete parallel.

If "Ice.Trace.Protocol=0" on both client and server, then I am seeing the operations become partially serialized in an erratic way; sometimes partial parallelism all the way to almost complete serialization.

I'm mystified. Any ideas on what is happening or how to find the issue?

Comments

  • keckrlkeckrl Member Robert KeckOrganization: University of RochesterProject: Distributed device control system
    Additional info

    By running the server on another machine and looking at the network traffic with Netmon, I can see that the issue must be on the server side. I can see the requests go out in a batch from the client, but the responses come back from the server in smaller batches separated by 2 seconds (my common delay) which indicates the server must be serializing the requests.

    Even running on separate machines, setting "Ice.Trace.Protocol=1" on the client improves server performance but doesn't completely fix it.

    Setting "Ice.Trace.Protocol=1" on the server, pretty much fixes the issue.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    Could you perhaps send us your test case so that we can give it a try to investigate the issue?

    If you have correctly configured the thread pool on the server side with multiple threads (Ice.ThreadPool.Server.Size=N) and didn't configure serialization (Ice.ThreadPool.Server.Serialize), the server should definitely dispatch requests from the same connection to multiple threads when necessary.

    Cheers,
    Benoit.
  • keckrlkeckrl Member Robert KeckOrganization: University of RochesterProject: Distributed device control system
    Test case

    I have attached my test case. The expected behavior on the client console is a batch of setting messages, a 2 second pause and then a batch of done messages a 2 second pause then repeat.
  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Robert,

    Thanks for the test case. I was able to reproduce the problem and it is unfortunately a bug in the Ice for .NET runtime. I've posted a patch that should resolve the issue, see this thread.

    Cheers,
    Benoit.
  • keckrlkeckrl Member Robert KeckOrganization: University of RochesterProject: Distributed device control system
    OK. Thank you for looking into this and coming up with a patch.
Sign In or Register to comment.