CESNET / libnetconf

C NETCONF library
Other
113 stars 84 forks source link

is libnetconf threadsafe? #140

Open krishnakumar4a4 opened 8 years ago

krishnakumar4a4 commented 8 years ago

Hi, We have started 10netopeer instances with a single libnetconf library. We want to change this behavior such that one netopeer instance supports all the 10connections and work differently on different datastores. So I would like to check whether libnetconf is threadsafe for such an implementation? I am using libnetconf-0.9.x

Regards, Krishna kumar.

michalvasko commented 8 years ago

Hi Krishna, libnetconf-0.9.x nor 0.10.0 are not thread-safe, generally speaking. Some use-cases may work, but they are not documented anywhere. Recent libnetconf 0.10.0 commits improved its thread-safety a bit, so you may want to use that one. Nevertheless, we are planning for libnetconf2 to be thread-safe or at least to be documented with details on what is thread-safe and what is not, bit its public release will not be ready for some time.

Regards, Michal

krishnakumar4a4 commented 8 years ago

Hi Michal, Thank you very much for your answer, I would like to check its limits now. I will let you know with any useful results in this direction.

windy32 commented 8 years ago

Hi, I still have a question about thread-safety:

Is is safe if I create a few threads and these threads do not interact with each other (a session created in each thread, and it does not know what other threads are doing) ?

rkrejci commented 8 years ago

yes, such a use case should be thread-safe