From owner-freebsd-hackers Wed Jan 13 18:39:34 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA02009 for freebsd-hackers-outgoing; Wed, 13 Jan 1999 18:39:34 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp04.primenet.com (smtp04.primenet.com [206.165.6.134]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA02002 for ; Wed, 13 Jan 1999 18:39:28 -0800 (PST) (envelope-from tlambert@usr02.primenet.com) Received: (from daemon@localhost) by smtp04.primenet.com (8.8.8/8.8.8) id SAA16535; Wed, 13 Jan 1999 18:58:04 -0700 (MST) Received: from usr02.primenet.com(206.165.6.202) via SMTP by smtp04.primenet.com, id smtpd016379; Wed Jan 13 18:57:51 1999 Received: (from tlambert@localhost) by usr02.primenet.com (8.8.5/8.8.5) id SAA12304; Wed, 13 Jan 1999 18:57:44 -0700 (MST) From: Terry Lambert Message-Id: <199901140157.SAA12304@usr02.primenet.com> Subject: Re: Problems with 3.0 To: peter.jeremy@auss2.alcatel.com.au (Peter Jeremy) Date: Thu, 14 Jan 1999 01:57:43 +0000 (GMT) Cc: hackers@FreeBSD.ORG, tlambert@primenet.com In-Reply-To: <99Jan14.104510est.40358@border.alcanet.com.au> from "Peter Jeremy" at Jan 14, 99 10:45:41 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >Another one recently discovered is that it *appears* that you can > >map (read only) the same file twice letting the system decide where > >to put it (pass NULL as binding location), and the second time the > >system will return the same address as the first time, instead of > >doing the right thing and setting up the mapping at a different > >location. > > Why is this behaviour wrong? Given that both mappings are read-only > and you haven't said that you want it mapped at a specific location, > why shouldn't the system just reuse the pre-existing mapping? This > is definitely easier for the kernel, and reduces system resource > requirements (page table entries and suchlike). Because it doesn't reference count the unmappings. This damages data encapsulation sematics. If I have: some_context * f1_open() { some_context *ctxp; ctxp = (some_context *)malloc(sizeof(some_context)); ctxp->sc_region = mmap( ...); } different_context * f2_open() { different_context *ctxp; ctxp = (different_context *)malloc(sizeof(different_context)); ctxp->dc_region = mmap( ...); } then I'm screwed, since if I: c1 = f1_open(); c2 = f2_open(); do_some_stuff( c1); f1_close( c1); /* XXX blows c2's head off*/ do_different_stuff( c2); f2_close( c2); references to c2->dc_region will explode because the region is no longer valid. If this type of thing is OK, then I'm anticipating your implementation of WSOCK32.DLL for FreeBSD so we can "take all the socket bloat out of the kernel, since kernel-based resource tracking is unnecessary"... Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message