I've fixed the subscribe sychronization problem,
in the develop branch, under
bug 474905: MQTTClient: insufficient synchronization
for subscribe, unsubscribe, connect
(
https://bugs.eclipse.org/bugs/show_bug.cgi?id=474905)
Ian
On
08/13/2015 11:50 AM, Ian Craggs wrote:
Hi Laurent,
sorry, I was wrong, and you are right! Apparently I
forgot my intentions in writing the MQTTClient
library. I will update the documentation to be
clear on this point.
I am just writing a test for multi threaded access
in the MQTTClient library, when setting the
callbacks. I think what you are seeing in
subscribe() is a bug, which I will fix. The calls
to publish() seem to be working fine.
Ian
On
08/10/2015 01:22 PM, Laurent FAILLIE wrote:
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.
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