On 15.01.2011 22:54, Pavel Sanda wrote:
Peter Kümmel wrote:
When a thread enters a function which another thread is busy on it hangs
in the lock, if it wouldn't wait the the chaos would become even worse.
The mutex only guaranties that one operation is finished before the next
starts.
yep, i know whot is mutex for. my question was about the graph scenario
problems.
disseminating mutexes all over the place smells like asking for deadlock,
hope you know how the graph code is entangled...
Yes, it is a risk, but we must make our code more thread safe if we don't
wanna have crashes "here and there".
sure, the problem is how to do that. is two threads need create graph path
the we need two graph data structures for each thread and not thread safe
graph. these mutexes will not prevent code failure, though it may not crash.
OK, when we really need a graph objects for each thread,
then my patch is wrong.
do you plan to attack another classes ?
No, I only added the Mutex class because in src we've no Qt.
Peter
pavel