Re: HEADS UP: Win32/OS2/BeOS native ports

From: "Igor Kovalenko" <Igor(dot)Kovalenko(at)motorola(dot)com>
To: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "mlw" <markw(at)mohawksoft(dot)com>, "Marc G(dot) Fournier" <scrappy(at)hub(dot)org>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: HEADS UP: Win32/OS2/BeOS native ports
Date: 2002-06-03 21:53:51
Message-ID: 0e0a01c20b49$26e90a00$22c30191@comm.mot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

That's what Apache does. Note, on most platforms MAP_ANON is equivalent to
mmmap-ing /dev/zero. Solaris for example does not provide MAP_ANON but using

fd=open(/dev/zero)
mmap(fd, ...)
close(fd)

works just fine.

----- Original Message -----
From: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Igor Kovalenko" <Igor(dot)Kovalenko(at)motorola(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>; "mlw" <markw(at)mohawksoft(dot)com>; "Marc G.
Fournier" <scrappy(at)hub(dot)org>; <pgsql-hackers(at)postgresql(dot)org>
Sent: Sunday, June 02, 2002 7:47 PM
Subject: Re: [HACKERS] HEADS UP: Win32/OS2/BeOS native ports

> Igor Kovalenko wrote:
> > It does not have to be anonymous. POSIX also defines shm_open(same
arguments
> > as open) API which will create named object in whatever location
corresponds
> > to shared memory storage on that platform (object is then grown to
needed
> > size by ftruncate() and the fd is then passed to mmap). The object will
> > exist in name space and can be detected by subsequent calls to
shm_open()
> > with same name. It is not really different from doing open(), but more
> > portable (mmap() on regular files may not be supported).
>
> Actually, I think the best shared memory implemention would be
> MAP_ANON | MAP_SHARED mmap(), which could be called from the postmaster
> and passed to child processes.
>
> While all our platforms have mmap(), many don't have MAP_ANON, but those
> that do could use it. You need MAP_ANON to prevent the shared memory
> from being written to a disk file.
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-06-03 22:34:19 Re: Search from newer tuples first, vs older tuples first?
Previous Message mlw 2002-06-03 21:38:17 Re: HEADS UP: Win32/OS2/BeOS native ports