Closed GoogleCodeExporter closed 8 years ago
Hello Dzmitry,
I cannot figure out what is problem you come with.
IMO,
- Generally, Signals and slots should work very well in a separate thread.
- "Eventdriven" mode will not freeze any thread unless you called waitXXX.
And in "Poling" mode, wartForReadyRead() should be useless, In my option,
simply call read() will get the same blocking effect.
Original comment by dbzhang...@gmail.com
on 17 Nov 2011 at 4:50
Hi,
Please see my answers:
" Generally, Signals and slots should work very well in a separate thread."
> Signals yes, but with the slots there are some problems, see here for ex:
http://developer.qt.nokia.com/wiki/Threads_Events_QObjects
See the section "DOs and DON'Ts". And for me it didn't work somehow as well.
""Eventdriven" mode will not freeze any thread unless you called waitXXX."
>My software constantly reading data from the port and displaing it on the
graph,
And I have experienced the freezing of the mouse in the graph each time the
data is reading out from the port (i.e. slot onReadyRead execution). I'm not
using any "wait" there. Note, that in this case the QExtSerialPort object lives
in the GUI thread.
This problem is perfectly solved when I move the QExtSerialPort object into a
separate thread, then I had a problem with the slots in "EventDriven" mode,
therefore I've switched to "Pooling".
"And in "Poling" mode, wartForReadyRead() should be useless, In my option,
simply call read() will get the same blocking effect."
> You are right! I just didn't know that.
Thanks!
Original comment by dstep...@gmail.com
on 17 Nov 2011 at 8:48
yeap, this is a very good article, I have read it. It pointed out many traps
when using QThread.
However, Signals and slots still works well with QThread. If you not familar
with it yet, the manual may be useful for you:
http://doc.qt.nokia.com/4.8/thread-basics.html
If "Eventdriven" mode really freeze your thread, it is most likely to be an bug
in QextSerialPort.
Original comment by dbzhang...@gmail.com
on 17 Nov 2011 at 12:50
Original comment by dbzhang...@gmail.com
on 16 Mar 2012 at 8:59
Original issue reported on code.google.com by
dstep...@gmail.com
on 16 Nov 2011 at 8:43