QT中的线程问题 [英] Problem in threading in QT

查看:116
本文介绍了QT中的线程问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在qt的线程中有一个问题。我的应用程序创建几个数据库。我一直在使用QSQLITE。当我运行我的应用程序。线程一启动和工作成功然后当线程一工作,线程二开始创建另一个DB。但它是QSQLDriver上的错误。我已经使用QMutex或QMutexLocker,但问题仍然存在。

I have a problem in threading in qt. my application create several databases. i've been uses QSQLITE. when i run my app. thread one start and work successfully then when thread one on working, thread two start for creating another DB. but it's error on QSQLDriver. I've been used QMutex or QMutexLocker, but problem still remain.

请帮助我。

/ p>

Thanks

推荐答案

我建议你不要使用Qt库中的低级函数和资源,使用相同的C标准或STL.even使用boost但不要使用Qt.Because Qt强迫你使用只使用Qt和关闭其他资源:例如在多级,不允许切换到其他线程的每个地方,如IPC,或其他低级资源Qt有问题。不要使用Qt。

I recommend you don't use low level functions and resource from Qt library, use same C standard or STL.even use boost but don't use Qt.Because Qt forces you to use just use Qt and close other resources: e.g in multithrading, don't allow to switch every where to other thread.Such as IPC , or other low level resource Qt has problem.Don't use Qt.

这篇关于QT中的线程问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆