octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread-safety issues in QtHandles


From: John W. Eaton
Subject: Re: Thread-safety issues in QtHandles
Date: Mon, 31 Oct 2011 01:19:01 -0400

On 30-Oct-2011, Michael Goffioul wrote:

| As a follow-up, I've been considering replacing reference counting in
| octave with shared_ptr (afaik, reference counting is thread-safe in
| shared_ptr implementation). I've converted liboctave (Array, Sparse,
| idx_vector...) and most of octinterp. However, I'm having a hard time
| converting octave_value/octave_base_value classes.
| 
| The main problem is that when using shared_ptr, the underlying class
| does not have any counter anymore, as it's managed by the shared_ptr.
| However, there are various places where the "count" member is used,
| for instance to return itself (octave_base_value*) wrapped in an
| octave_value object. Typical example is the subsasgn method.

Right, the idea there is to increment the count so that the object
that is being wrapped won't be deleted early.  Maybe that is not an
issue with a shared_ptr?  I don't know, as I don't understand
precisely how it is supposed to work in place of reference counting.

| I've
| considered to change return type octave_base_value::subsasgn to void
| (any implementation is supposed to return itself anyway), but I think
| that'll break the octave_class code. So if anybody (probably jwe?)
| could give me a hand on this one, I'd really appreciate.

It would probably help me understand how this should work if you could
post the changes for one of the classes that you have already
converted.  The Array class would probably be a good one to start
with.

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]