这是一个创建于 1634 天前的主题,其中的信息可能已经有所发展或是发生改变。
qt 中一个线程 A 发送信号 Q_SIGNAL 让另外一个线程 B 来处理,如果此时线程 B 正在忙于繁忙任务(比如需要执行一分钟)。那么这个信号将被怎么处理?如下:
等待? - 等待超时多久。
排队? - 队列长度多少。
丢弃? - 能否再次发送。
2 条回复 • 2020-12-30 13:15:30 +08:00
 |
|
1
billlee 2020-12-17 17:56:03 +08:00 1
对于 A 来说, 消息写入 B 的消息队列就返回了,不会等待 消息队列没有长度限制 如果 B 一直不从事件循环里取消息,那就一直堆着,直到内存用尽
|
 |
|
2
KaoN 2020-12-30 13:15:30 +08:00
Qt::QueuedConnection 2 The slot is invoked when control returns to the event loop of the receiver's thread. The slot is executed in the receiver's thread.
|