From owner-freebsd-hackers Tue Jan 13 20:31:27 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA12403 for hackers-outgoing; Tue, 13 Jan 1998 20:31:27 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from wcc.wcc.net (wcc.wcc.net [208.6.232.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA12333 for ; Tue, 13 Jan 1998 20:31:05 -0800 (PST) (envelope-from piquan@wcc.wcc.net) Received: from detlev.UUCP (tnt167.wcc.net [208.10.139.167]) by wcc.wcc.net (8.8.7/8.8.7) with ESMTP id WAA21414 for ; Tue, 13 Jan 1998 22:27:28 -0600 (CST) Received: (from joelh@localhost) by detlev.UUCP (8.8.8/8.8.7) id WAA03884; Tue, 13 Jan 1998 22:30:46 -0600 (CST) (envelope-from joelh) Date: Tue, 13 Jan 1998 22:30:46 -0600 (CST) Message-Id: <199801140430.WAA03884@detlev.UUCP> To: freebsd-hackers@FreeBSD.ORG In-reply-to: <19980112112455.48744@flix.net> (message from Chrisy Luke on Mon, 12 Jan 1998 11:24:55 +0000) Subject: Re: sharable static arrays? From: Joel Ray Holveck Reply-to: joelh@gnu.org References: <199801121031.EAA00243@detlev.UUCP> <19980112112455.48744@flix.net> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk >> 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)). Hmm... Perhaps I should have used the C term. For what I meant by 'static array', mmap (et al) would be utterly wrong. My fault. Are arrays declared const shared across multiple invocations of a program? That is, if I have an array const int foo[8192] = {...}; then will each instance of the invocation separately allocate 16k for an array that's never going to change, and exists as it is in the executable? Cheers, joelh -- Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped