Is JPushClientV3.SendPushMessage threadsafe?

Aug 19, 2014 at 8:01 AM

Can I create a single JPushClientV3 instance and use it to send (via SendPushMessage) JPush messages over multiple threads in parallel without serializing the access to the JPushClientV3 instance object?
Aug 20, 2014 at 2:58 AM
Hi mstavrev,
JPushClientV3 is thread safe, because all of the shared variables is readonly for sending messages. But I cannot understand clearly what you mean for serializing the access? Could you please describe your scenario?
Aug 20, 2014 at 7:04 AM
I meant the following scenario:
  • Create an instance of the JPushClientV3 class
  • In multiple threads call the SendPushMessage method without locking the access to the instance (no serialization over the method access)
Nevermind, I downloaded the source code and from my quick observations it seems that this is completely safe and the SendPushMessage method is indeed threadsafe.