Re: [HACKERS] Memory mapping (Was: Safe/Fast I/O ...) - Mailing list pgsql-hackers

From Matthew N. Dodd
Subject Re: [HACKERS] Memory mapping (Was: Safe/Fast I/O ...)
Date
Msg-id Pine.BSF.3.96.980414221111.7475L-100000@sasami.jurai.net
Whole thread Raw
In response to Memory mapping (Was: Safe/Fast I/O ...)  (Michal Mosiewicz <mimo@interdata.com.pl>)
List pgsql-hackers
On Wed, 15 Apr 1998, Michal Mosiewicz wrote:
> isolated from files it's possible to close some descriptors without
> throwing buffers. However it seems (tried it) that memory mapping works
> even after a file descriptor is closed. So, is this possible to cross
> the limit of open files by using memory mapping? Or maybe the descriptor
> remains open until munmap call? Or maybe it's just a Linux feature?

Nope, thats how it works.

A good friend of mine used this in some modifications to INN (probably in
INN -current right now).

Sending an article involved opening the file, mmapping it, closing the fd,
writing the mapped area and munmap-ing.

Its pretty slick.

Be careful of the file changing under you.

/*
   Matthew N. Dodd        | A memory retaining a love you had for life
   winter@jurai.net        | As cruel as it seems nothing ever seems to
   http://www.jurai.net/~winter | go right - FLA M 3.1:53
*/


pgsql-hackers by date:

Previous
From: Ryan Kirkpatrick
Date:
Subject: Re: [HACKERS] Linux/Alpha and pgsql....
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Memory mapping (Was: Safe/Fast I/O ...)