Skip site navigation (1) Skip section navigation (2)

Re: Spinlock performance improvement proposal

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: mlw <markw(at)mohawksoft(dot)com>
Cc: "D(dot) Hageman" <dhageman(at)dracken(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Spinlock performance improvement proposal
Date: 2001-09-29 03:41:18
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> Bruce Momjian wrote:
> > 
> > > Save for the fact that the kernel can switch between threads faster then
> > > it can switch processes considering threads share the same address space,
> > > stack, code, etc.  If need be sharing the data between threads is much
> > > easier then sharing between processes.
> > 
> > Just a clarification but because we fork each backend, don't they share
> > the same code space?  Data/stack is still separate.
> In Linux and many modern UNIX programs, you share everything at fork time. The
> data and stack pages are marked "copy on write" which means that if you touch
> it, the processor traps and drops into the memory manager code. A new page is
> created and replaced into your address space where the page, to which you were
> going to write, was.

Yes, very true.  My point was that backends already share code space and
non-modified data space.  It is just modified data and stack that is
non-shared, but then again, they would have to be non-shared in a
threaded backend too.

  Bruce Momjian                        |
  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


pgsql-hackers by date

Next:From: mlwDate: 2001-09-29 04:28:43
Subject: Re: Spinlock performance improvement proposal
Previous:From: mlwDate: 2001-09-29 03:26:32
Subject: Re: Spinlock performance improvement proposal

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group