From owner-freebsd-hackers Mon Jan 12 11:55:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.7/8.8.7) id LAA20953 for hackers-outgoing; Mon, 12 Jan 1998 11:55:52 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from misery.sdf.com (misery.sdf.com [204.244.210.193]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id LAA20933 for ; Mon, 12 Jan 1998 11:55:42 -0800 (PST) (envelope-from tom@sdf.com) Received: from tom by misery.sdf.com with smtp (Exim 1.73 #1) id 0xrpig-0002Qz-00; Mon, 12 Jan 1998 11:40:22 -0800 Date: Mon, 12 Jan 1998 11:40:22 -0800 (PST) From: Tom To: Chrisy Luke cc: joelh@gnu.org, freebsd-hackers@FreeBSD.ORG Subject: Re: sharable static arrays? In-Reply-To: <19980112194053.29382@flix.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk 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