Thread-safe access to graphic objects - proposal
Driss Ghaddab
driss.ghaddab at free.fr
Sat Jul 5 02:26:22 CDT 2008
Maciek Gajewski wrote:
> Driss Ghaddab wrote
>
> Event 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 Gajewski
>
>> To 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.
>
>
More information about the Octave-maintainers
mailing list