Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

跨线程信号槽带来的内存问题 #435

Open
Notify-ctrl opened this issue Dec 16, 2024 · 0 comments
Open

跨线程信号槽带来的内存问题 #435

Notify-ctrl opened this issue Dec 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Notify-ctrl
Copy link
Collaborator

如题,主要是Router::messageReady信号这一块。在主线程释放这个信号会让程序直接调用后续的socket::send函数,而在其他线程中调用该函数时则只是向队列中添加一个信号,实际的send操作仍在主线程进行。这就导致主线程中signal队列容易不断增长导致内存消耗不断提升(signal产生的速度很多时候比slot函数处理它的速度更快)

解决方案:我想不到,所以先记录在issue

参考 https://doc.qt.io/qt-6/threads-qobject.html#signals-and-slots-across-threads

@Notify-ctrl Notify-ctrl added the bug Something isn't working label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant