Hi there!
I have got a simple question. I have my class with QObject as a base class, which runs in a separate the QThread. It is purely event driven class, it does not run any processing continually. It has several slots and signals connected by QueuedConnection to signals/slots of similar class instances also with QObject as a base class, each running in its own QThread.
Every important slot of this QObject-like class uses member variables - they are shared between several slots. My question is, whether I need to use mutexes or not to synchronize access to these member variables.
From my point of view, I do not. I imagine the process like this: every connection with other QObjects' signals/slots is of QueuedConnection type and QThread event loop executes only one slot at a time. Therefore, if two slots, both changing same shared variables, are called at approximately same time, they are executed in the order they were put in the queue.
Am I right?
Boris
This post has been edited 2 times, last edit by "juchuchuu" (May 18th 2012, 7:48pm)