Date: Mon, 12 Jan 1998 19:40:53 +0000 From: Chrisy Luke <chrisy@flix.net> To: Tom <tom@sdf.com> Cc: joelh@gnu.org, freebsd-hackers@FreeBSD.ORG Subject: Re: sharable static arrays? Message-ID: <19980112194053.29382@flix.net> In-Reply-To: <Pine.BSF.3.95q.980112105953.9226C-100000@misery.sdf.com>; from Tom on Mon, Jan 12, 1998 at 11:16:48AM -0800 References: <19980112112455.48744@flix.net> <Pine.BSF.3.95q.980112105953.9226C-100000@misery.sdf.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Tom wrote (on Jan 12): > > 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. In this case, of course, the area should be marked volatile... :-) Chris. -- == chris@easynet.net, chrisy@flix.net, chrisy@flirble.org. == Head of Systems for Easynet Group PLC.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980112194053.29382>