PDA

View Full Version : multi threads



weixj2003ld
9th April 2009, 04:58
Hello,evry one.
When I create two threads and shared a class.In the class,I synchronize the method (with
QMutexLocker locker(&mutex); ) used by the threads,I find that does not speed up the progress on the dual-core CPU.Does not synchronization speed up the progress in the multi-threads?

weixj2003ld
9th April 2009, 05:07
When Synchronizing the threads,I did as follows,Am I right or not?


Class A
{
public:
void caculate()
{
QMutexLocker locker(&mutex);
....
}
public:
mutable QMutex mutex;
}

weixj2003ld
9th April 2009, 07:57
please answer my question.