我想知道qt如何决定哪种调度信号的工作方式。qt发射信号如何将信号与并发线程一起工作
在http://qt-project.org/doc/qt-4.8/threads-qobject.html#signals-and-slots-across-threads 我发现
Auto Connection (default) If the signal is emitted in the thread which the receiving object has affinity then the behavior is the same as the Direct Connection. Otherwise, the behavior is the same as the Queued Connection.
什么是在这种情况下,意义affinity
?
Qt如何知道哪个线程使用对象的方法来防止信号数据损坏? affinity
线程是创建对象的线程吗?
的螺纹上的事件:“每个对象与它的父对象具有相同的线程“,这是否意味着在另一个线程中创建子对象会从父对象”继承“线程”affinity“? – Klaus
您不能在另一个线程上使用对象的父对象。作为moveToThread状态的文档:“这个函数只能将一个对象从当前线程”推送“到另一个线程,它不能将一个对象从任意线程”拉“到当前线程。” – TheDarkKnight