qt 中一个线程 A 发送信号 Q_SIGNAL 让另外一个线程 B 来处理,如果此时线程 B 正在忙于繁忙任务(比如需要执行一分钟)。那么这个信号将被怎么处理?如下:
等待? - 等待超时多久。
排队? - 队列长度多少。
丢弃? - 能否再次发送。
等待? - 等待超时多久。
排队? - 队列长度多少。
丢弃? - 能否再次发送。
1
billlee Dec 17, 2020 对于 A 来说, 消息写入 B 的消息队列就返回了,不会等待
消息队列没有长度限制 如果 B 一直不从事件循环里取消息,那就一直堆着,直到内存用尽 |
2
KaoN Dec 30, 2020
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.
|