Closed fxsjy closed 7 years ago
Short answer: No it isn't.
I must admit I didn't try to share any tinyrpc instance between threads. But checking the code I do not think that any part of tinyrpc is thread safe. So the problems you experience are probably not unique for zmq.
If you really must share any tinyrpc instance between threads you should provide your own locking or local storage mechanism. Tinyrpc really isn't designed for this use case.
However, giving each thread its own client should work. Do let me know if that scenario doesn't work.
@lnoor , thank you. I added a lock myself before call tinyrpc client, then it solved the problem.
I tried to call same rpc client object in multi-threads,and got some exceptions raised by zmq.