Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!nx02.iad01.newshosting.com!newshosting.com!64.59.134.4.MISMATCH!pd7cy3no!pd7cy4no!shaw.ca!pd7urf3no.POSTED!53ab2750!not-for-mail
X-Trace-PostClient-IP: 24.79.146.116
From: Walter Roberson <roberson@hushmail.com>
Organization: Canada Eat The Cookie Foundation
User-Agent: Thunderbird 2.0.0.16 (Windows/20080708)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: Sharing data between GUIs without using workspace
References: <g9q87n$kc8$1@fred.mathworks.com> <wM2wk.67483$hx.28408@pd7urf3no> <g9r7j9$5ca$1@fred.mathworks.com>
In-Reply-To: <g9r7j9$5ca$1@fred.mathworks.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 36
Message-ID: <0jdwk.68169$hx.38144@pd7urf3no>
Date: Fri, 05 Sep 2008 16:41:32 GMT
NNTP-Posting-Host: 24.66.94.143
X-Complaints-To: abuse@shaw.ca
X-Trace: pd7urf3no 1220632892 24.66.94.143 (Fri, 05 Sep 2008 10:41:32 MDT)
NNTP-Posting-Date: Fri, 05 Sep 2008 10:41:32 MDT
Xref: news.mathworks.com comp.soft-sys.matlab:488829



carlos lopez wrote:
> Walter Roberson <roberson@hushmail.com> wrote in message <wM2wk.67483$hx.28408@pd7urf3no>...

>> I don't think you would be able to "share"
>> variables between the two in the sense that changing the
>> value of the variable in one of them would automatically
>> change the value of the variable in the other (though I would
>> not rule out that possibility -completely-.)

> It depends on the underlying OS. I am aware that such mechanism exist at 
> least in LINUX, and one example is the one which allows changing the language 
> environment and it might affect immediately all the (properly coded) applications.

In computer languages such as C, you can have pointer variables that can point
into a shared memory (or memory mapped) block of memory; if multiple processes
share the block, then a change by one of the processes of the content of the
block will affect the other processes "automatically" (provided that in C
or C++ you declared the variables to be 'volatile' so that the compilers do
not rely on a copy of the value they have stuffed into a register and do
not make optimizations that depend upon the value of the variable being
a constant within a loop.)

But in Matlab, there are no user-level pointers and no commands that I know of
to place variables within shared areas (you would have to disable copy-on-write
for such variables, of course.) You might perhaps be able to do it at the
mex level by requesting an array header and setting its data pointer as
you wanted into the shared area, but that would have problems at least as great
as those that occur when you malloc() space for a variable in C. I believe that
I've read postings from people who say that you can do that if you are careful;
I have never looked at the details myself. I suspect the Matlab routines are not
designed with the expectation that they might be dealing with volatile memory.

-- 
Q = quotation(rand);
if isempty(Q); error('Quotation server filesystem problems')
else sprintf('%s',Q), end