Re: Spinlock performance improvement proposal

From: mlw <markw(at)mohawksoft(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
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:26:32
Message-ID: 3BB53F68.3270BB17@mohawksoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-09-29 03:41:18 Re: Spinlock performance improvement proposal
Previous Message mlw 2001-09-29 03:13:59 Re: Spinlock performance improvement proposal