Home Help Center

Is it safe to share Ice::CommunicatorPtr between threads?

ablmfablmf Member Peter CaiOrganization: Vimicro.comProject: Iris
Hi all,

I am using Ice for serialize and deserialize purpose only. And I don't want to create CommunicatorPtr every time.

So it seems to be a good idea to create one and only one CommnicatorPtr instance and share it between threads.

Is it OK to use it in this way?

And is there anyway to use reuse Ice::OutputStreamPtr? I really don't like to create it again and again……

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi,

    Yes, the communicator object is thread safe. However, the input/output stream objects aren't since these are typically used from a single thread. There's also currently no way to re-use a given stream object.

    Cheers,
    Benoit.
Sign In or Register to comment.