Laurent,
that's great! If you do find any other problem, it will help to
get any error messages from the library, which you can do as I do in
the tests (like test2.c):
setenv("MQTT_C_CLIENT_TRACE", "ON", 1);
setenv("MQTT_C_CLIENT_TRACE_LEVEL", "ERROR", 1);
Thanks
Ian
On 08/14/2015 02:43 PM, Laurent FAILLIE
wrote:
Ok
I'll revert back to U
if I found other issue : for the moment, my new code, with
submitting in the main thread, works like a charm :)
Bye
Laurent
Hi Laurent,
I also moved some initialization code. The fix
works for the test (test2.c) that I wrote -- and
that test certainly failed for me before the fix.
I'm happy to fix any other synchronization bug if we
find it.
Ian
On
08/13/2015 05:10 PM, Laurent FAILLIE wrote:
Hi
Ian,
I read the comment you've put about mutex (but
didn't had a look on the changes you made on
the code itself :) ) ... If you have a look on
this commit ( https://github.com/destroyedlolo/Marcel/commit/f2c510018439140c52d81dffc3b1ad49a70a40e0)
of my tool "Marcel" : I added a semaphore
protection around each
"MQTTClient_subscribe()" to avoid concurrent
submitting ... and it failed.
It
isn't what you did ?
Bye
Laurent
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
_______________________________________________
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
_______________________________________________
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
|