Archived

This forum has been archived. Please start a new discussion on GitHub.

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

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

  • benoit
    benoit Rennes, France
    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.