help-octave
[Top][All Lists]
Advanced

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

Re: .oct files - keeping state across calls


From: Christophe Tournery
Subject: Re: .oct files - keeping state across calls
Date: Tue, 7 Jul 2009 23:17:10 +0200

Thanks for the tip, I did not know mlock().

However the problem is still there. The list of handles has a different memory address when calling the mylib_init() function and when calling the mylib_process() function. Has there been major changes from 3.0 to 3.2 regarding loading oct files?

Do you guys encounter this design problem often or is there a very simple solution I do not see?

-c

On Jul 6, 2009, at 5:20 PM, dbateman wrote:

Christophe Tournery-2 wrote:

Both mylib_init() and mylib_process() must share a list of allocated
handles and internal states of mylib. In octave 3.0 I used a static
std::map in my .cc file for the handles and that worked. In octave 3.2
this fails. It seems that in 3.2 the .oct file is loaded twice, once
for mylib_init() and once for mylib_process(), therefore the static
variable trick does not work anymore since they have different
addresses.


If you use the "mlock" function in the first call to the oct-file it should never be reloaded, and won't be cleared by a call to "clear all".. Does that
work for you?

D.

--
View this message in context: 
http://www.nabble.com/.oct-files---keeping-state-across-calls-tp24354462p24357169.html
Sent from the Octave - General mailing list archive at Nabble.com.

_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave



reply via email to

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