Thanks for your reply, Ian.
As per the documentation, MQTTClient_setCallbacks() triggers a thread for documents arrival, so I naively thought everything is thread safe.
As of now, I faced issues only when subscribing but my threads are publishing data as well : should I have some risk with that as well ?
The misspelling master is on the Web.
_________ 100 % Dictionnary Free !
/ /(
/ Dico / / Pleins d'autres fautes sur
/________ / /
(########( / http://destroyedlolo.info
Quoi, des fautes d'orthographe! Pas possible ;-D.
Le Lundi 10 août 2015 13h39, Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> a écrit :
Hi Laurent,
thanks for pointing this out, we should definitely make this clear.
The "synchronous" MQTTClient C API is not thread safe, as you have
found out. The asynchronous C API, "MQTTAsync", is.
Ian
On 08/09/2015 11:57 PM, Laurent FAILLIE
wrote:
Hello,
I'm using C
implementation of Paho library, and my program (https://github.com/destroyedlolo/Marcel)
is creating several threads to survey topics values : this
tool aims to raise alerts if they are out of margin (as
example, it send me an SMS if my photo-voltaic installation
didn't produced anything for a day).
In a previous version,
first I created childs threads and let them to subscribe to
topics ... and my tool crashed at startup due to memory
corruption or be disconnected from the broker.
Now, subscriptions is
done in the main process and then threads are created :
Marcel doesn't crash anymore.
I didn't find any
document saying paho subscription is not thread safe, so my
mail :)
Best regards,
Laurent
---
The misspelling
master is on the Web.
_________ 100 % Dictionnary Free !
/ /(
/ Dico / / Pleins d'autres fautes sur
/________ / /
(########( /
http://destroyedlolo.info
Quoi, des fautes d'orthographe! Pas possible ;-D.
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev
--
Ian Craggs
icraggs@xxxxxxxxxx IBM United Kingdom
Paho Project Lead; Committer on Mosquitto