[Development] [Interest] Heavily Commented Example: Simple Single Frontend with Two Backends

d3fault d3faultdotxbe at gmail.com
Mon Oct 22 07:20:02 CEST 2012


volatile bools work, but just know that every time you check it you are
doing a non-cached memory read (relatively slow). It can't read from the
cache/registers (much faster) because other threads/processes are allowed
to modify it at any time (and when they do, they don't/can't modify the
cached/in-register copy). I used to use volatile bools in a similar fashion
before I discovered Qt... but Qt provides much better ways for managing
threads.

If you only need to read from the serial port periodically, you can set
your backend up like I did for backend2 in the exampe... which also uses a
timer.

....but if it ain't broke, don't fix it...

d3fault
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20121021/7d230310/attachment.html>


More information about the Development mailing list