Results 1 to 10 of 10

Thread: Serialization only for the same request

  1. #1
    hui
    hui is offline Registered User
    Name: Fang Zhaohui
    Organization: Anhui University of Technology
    Project: Video Conferencing - RPC in video transcoding
    Join Date
    Sep 2011
    Posts
    11

    Question Serialization only for the same request

    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!

  2. #2
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    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.

  3. #3
    hui
    hui is offline Registered User
    Name: Fang Zhaohui
    Organization: Anhui University of Technology
    Project: Video Conferencing - RPC in video transcoding
    Join Date
    Sep 2011
    Posts
    11
    Quote Originally Posted by marc View Post
    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
    Code:
      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.

  4. #4
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    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.

  5. #5
    hui
    hui is offline Registered User
    Name: Fang Zhaohui
    Organization: Anhui University of Technology
    Project: Video Conferencing - RPC in video transcoding
    Join Date
    Sep 2011
    Posts
    11
    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.

  6. #6
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    No, there is no such interface. I'm sorry, but I'm afraid I don't have any other advice I can offer you.

  7. #7
    marc's Avatar
    marc is offline ZeroC Staff
    Name: Marc Laukien
    Organization: ZeroC, Inc.
    Project: The Internet Communications Engine
    Join Date
    Feb 2003
    Location
    Florida
    Posts
    1,860
    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.

  8. #8
    hui
    hui is offline Registered User
    Name: Fang Zhaohui
    Organization: Anhui University of Technology
    Project: Video Conferencing - RPC in video transcoding
    Join Date
    Sep 2011
    Posts
    11
    Now, i only use this to slove my problem.

    Thanks!
    hui.

  9. #9
    joshmoore is offline Registered User
    Name: Josh Moore
    Organization: Glencoe Software, Inc.
    Project: OMERO, http://trac.openmicroscopy.org.uk/omero
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    115
    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.

  10. #10
    hui
    hui is offline Registered User
    Name: Fang Zhaohui
    Organization: Anhui University of Technology
    Project: Video Conferencing - RPC in video transcoding
    Join Date
    Sep 2011
    Posts
    11
    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!

    Quote Originally Posted by joshmoore View Post
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 8
    Last Post: 04-14-2010, 04:44 AM
  2. Python serialization
    By Mako in forum Help Center
    Replies: 1
    Last Post: 02-28-2007, 02:54 PM
  3. Serialization without Transport
    By Andew in forum Help Center
    Replies: 7
    Last Post: 10-23-2006, 09:53 AM
  4. Is serialization zero copy?
    By Markus Bernhard in forum Help Center
    Replies: 4
    Last Post: 06-14-2006, 07:54 AM
  5. Object serialization in ICE
    By shantanu_k06 in forum Help Center
    Replies: 4
    Last Post: 02-17-2004, 01:00 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •