Home Help Center

Serialization only for the same request

huihui Member Fang ZhaohuiOrganization: Anhui University of TechnologyProject: Video Conferencing - RPC in video transcoding
Hi!
When using multi-threaded pool, the requests from the same operation (the operation may be called many times in a short time) in the same connection or different connection may be not be dispatched in the order they were received.
But I want they could be dispatched in the order they were received, others are not required, what do I do?

sorry, my English is poor!

Comments

  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    If you use multiple threads for dispatch, then your requests are processed in parallel, and you have no control over the ordering. This is nothing specific to Ice, but simply how multi-threaded systems work.

    For oneway requests in particular, see also this FAQ.
  • huihui Member Fang ZhaohuiOrganization: Anhui University of TechnologyProject: Video Conferencing - RPC in video transcoding
    marc wrote: »
    If you use multiple threads for dispatch, then your requests are processed in parallel, and you have no control over the ordering. This is nothing specific to Ice, but simply how multi-threaded systems work.

    For oneway requests in particular, see also this FAQ.

    Thanks for your answer.

    I'm sorry I didn't express my question clearly.
    I know you said.
    When the server employ a thread pool with multiple threads, We could force the thread pool to dispatch requests serially by setting one of properties Ice.ThreadPool.name.Serialize or adapter-name.ThreadPool.Serialize.

    A multi-threaded pool for serializtion can dispatch requests for different connections concurrently while serializing requests form the same connection.
    But this isn't what I want.

    My question is , for example
      xxx.ice
        ...
        interface A {
             ... // other operation
             int op(int argument);
        };
        ...
    
      client.cpp
        ... 
        APrx prx = ...;
        ...
        prx->begin_op(...);	// Time1
        prx->begin_op(...);         // Time2
        ...
    

    Server:
    Configuring the thread pool to support multiple threads, I want the same operation from the same connection or different connection can be dispatched and processed serialtized in the Server, but the different operations can be dispathced and processed in parallel.

    I want to know how to configure the Ice server or is there some interfaces for us to do this.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    You can configure two object adapters with different thread pools and thread pool properties. Then you could use one object adapter to serve Ice objects for which you want requests to be serialized, and another for which you want requests to be dispatched in parallel. Note that using two object adapters implies two connections from each client that uses them. I'm afraid there is no way to do what you want to do with just a single connection and a single object adapter, or for different functions of the same Ice object.
  • huihui Member Fang ZhaohuiOrganization: Anhui University of TechnologyProject: Video Conferencing - RPC in video transcoding
    The advice you gave can't slove my problem. I can't using two object adapters ...

    Configure the multile-threaded for serialization, that means Ice run time can get the order the requests were received. Is there a interface to let me get the order. If so, I could make the server dispatch the same requests serilized in implement of operation.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    No, there is no such interface. I'm sorry, but I'm afraid I don't have any other advice I can offer you.
  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Of course you could add ordering information to the operation itself, i.e., have your client send ordering information along with the rest of the request parameters.
  • huihui Member Fang ZhaohuiOrganization: Anhui University of TechnologyProject: Video Conferencing - RPC in video transcoding
    Now, i only use this to slove my problem.

    Thanks!
    hui.
  • joshmoorejoshmoore GermanyMember Josh MooreOrganization: Glencoe Software, Inc.Project: OME, http://openmicroscopy.org
    I'm not completely sure I understand either, but do you not want AMD? If server-side you hand off some AMD objects to a executor which only has a single thread then they would be processed serially (in the order the arrived at the server).

    Sorry if I misunderstood you,
    ~Josh.
  • huihui Member Fang ZhaohuiOrganization: Anhui University of TechnologyProject: Video Conferencing - RPC in video transcoding
    This method can really solve my problem. But I just want the same requests (caused by calling one special operation many times) cloud be processed serially, and others are processed in parallel. Taking the advice, that mean I have to do rewrite my Ice server. It is too much work. I want Ice can provide interfaces and configuration or just rewrite the special operation.

    Thanks all the same!
    joshmoore wrote: »
    I'm not completely sure I understand either, but do you not want AMD? If server-side you hand off some AMD objects to a executor which only has a single thread then they would be processed serially (in the order the arrived at the server).

    Sorry if I misunderstood you,
    ~Josh.
Sign In or Register to comment.