help-octave
[Top][All Lists]
Advanced

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

Re: Realtime cost of call by value


From: Glenn Golden
Subject: Re: Realtime cost of call by value
Date: Tue, 28 Oct 2003 19:52:37 -0700

Hi Geraint [Paul?] -

Geraint Paul Bevan writes:
>
> This is very ugly and does mean that you have to free (with delete) the
> memory associated with the pointers when you have finished with them,
> but it should be effective at eliminating the pass by value problem if
> you have a lot of data. Just pass the integer to your function and allow
> it to dereference it from within the function.

Thanks for your suggestion. Unfortunately, I suspect that it is
not going to help with the realtime problem, although it certainly
does do exactly what you say -- creates an ersatz handle that you
can use to access an object indirectly -- but I don't think it can
avoid the copy down.  So it won't have any effect on the call by
value realtime overhead, which is the issue for me.

>From what I can tell by stumbling thru Octave internals, I'm
getting to think that the central reason it's so tricky to work
around call by value copy-down overhead -- even at the DLD level --
is that copy-down is 'built in' to all of the methods that operate
on Octave objects.  It's not just something that the interpreter
does explicitly, which is what I had originally assumed.  If that
were the case, then I think it would be possible to sneak around
it at the DLD level in various [sinful] ways, including what you
suggest above using pointers, which I would gladly do.  But if
copy-down is built into the low-level methods, then there's no
way to play any kind of games behind the interpreter's back, even
in a DLD.  The moment you put an Octave object on the LHS of
an assignment -- even in C++ code, dereferencing the object through
a pointer -- the copy down occurs, and your lunch is eaten. 

Again, I emphasize the above is guesswork on my part, and I will
be only too happy to have John or someone tell me that I am
hallucinating.  But the above hypothesis is consistent with all
the behavior that I observed so far in my attempts to get around
copy-down.


- Glenn



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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