Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Jan 1998 11:40:22 -0800 (PST)
From:      Tom <tom@sdf.com>
To:        Chrisy Luke <chrisy@flix.net>
Cc:        joelh@gnu.org, freebsd-hackers@FreeBSD.ORG
Subject:   Re: sharable static arrays?
Message-ID:  <Pine.BSF.3.95q.980112113916.9226D-100000@misery.sdf.com>
In-Reply-To: <19980112194053.29382@flix.net>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 12 Jan 1998, Chrisy Luke wrote:

> > > Joel Ray Holveck wrote (on Jan 12):
> > > > Are static arrays shared across multiple invocations of a program?
> > > 
> > > Not intrinsicly. You'll have to either use SYS-V style shared
> > > memory (options SYSVSHM SYSVSEM SYSVMSG in a kernel config and
> > > shmget(2) etc) or use BSD style mapped memory (mmap(2)).
> > 
> >   Remember these are _static_ arrays, which mean they are directly coded
> 
> He said static, not const. There's a difference. Static data can be
> modified, it's just by inference hidden from higher scopes.
> 
> Static memory is shared (it's setup by the C startup module) in so far
> as the initial state is the same. Any changes will not be seen across
> multiple invokations. For that, you need shared memory of some nature.

  Assuming you want changes visable to other invocations.  Many times you
do not.  But since he asked about static data, I assume that changes would
not be made.

Tom




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.95q.980112113916.9226D-100000>