|
From: | Driss Ghaddab |
Subject: | Re: Thread-safe access to graphic objects - proposal |
Date: | Sat, 05 Jul 2008 09:26:22 +0200 |
User-agent: | Thunderbird 2.0.0.14 (X11/20080502) |
Maciek Gajewski wrote:
Driss Ghaddab wroteEvent when properties are only read, they have to be protected by mutex, to retain consistency ant to keep them from being deleted in another thread.
If the other thread can modify the value, then yes it has to be protected. But if not, then it does not need to.
It is the GUI responsibility to delete the object. The octave thread retains only an index on the object, when it tries to access it, a lookup is done and checks that the object is living.
Maciek GajewskiTo set an object property, there are four cases: - octave thread can set the value, but it needs to protect from mutual access (i.e. the GUI thread may modify the value, thus the mutex); - octave thread can set the value, but it does not need to protect from mutual access (i.e. the GUI thread never modifies that value) - octave thread is not allowed to modify the value and delegates the task to the GUI thread, - or, the property is read only and it is not allowed to modify it.
[Prev in Thread] | Current Thread | [Next in Thread] |