From owner-freebsd-hackers Tue Jan 13 17:14:17 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA11690 for hackers-outgoing; Tue, 13 Jan 1998 17:10:44 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from fang.cs.sunyit.edu (root@fang.cs.sunyit.edu [192.52.220.66]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id RAA11169 for ; Tue, 13 Jan 1998 17:05:56 -0800 (PST) (envelope-from perlsta@sunyit.edu) Received: from win95.local.sunyit.edu (ppp-9.ts-12.nyc.idt.net [169.132.100.9]) by fang.cs.sunyit.edu (8.8.5/8.7.3) with ESMTP id DAA28451; Tue, 13 Jan 1998 03:34:25 GMT Message-Id: <199801130334.DAA28451@fang.cs.sunyit.edu> From: "Alfred Perlstein" To: "Chrisy Luke" , "Tom" Cc: , Subject: Re: sharable static arrays? Date: Tue, 13 Jan 1998 02:30:17 -0500 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1161 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@freebsd.org Precedence: bulk just an idea, wouldn't there be a way to tell the compiler to mark a segement of data as program TEXT? That way when you fork() there's only one copy, the origional. this would also help protect against it being corrupted if the segment was marked read only... ie seg fault sorry i have no clue on how to do this though.... -Alfred ---------- > From: Chrisy Luke > To: Tom > Cc: joelh@gnu.org; freebsd-hackers@FreeBSD.ORG > Subject: Re: sharable static arrays? > Date: Monday, January 12, 1998 2:40 PM > > 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.