pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sqyang <sqyang@nudt.edu.cn>
To: pgsql-sql@postgreSQL.org
Subject: the differences between semaphores and spinlocks
Date: Mon, 30 Nov 1998 10:43:15 +0800
Message-ID: <36620643.1FE37641@nudt.edu.cn> (raw)

Hi:
	I want to do somework on postgresql's parallelization. I found that
postgresql uses two kinds of locks: semaphores and spinlocks. The
platform I used now is linux-elf's. In such platform, the default
options is spinlocks. The question is: if two processes(p1 and p2) use
spinlocks for mutex using of resource, and p1 acquires the lock and p2
has to wait for the lock and enter suspended state. When p1 release the
lock, is p2 be activated by os?
	The real situation is: I want to implement a parallel backend through
multi engines and multi I/O processes in multi PCs. Each PC contains an
engine and an I/O process. The engine and I/O process share the same
buffer pool and through spinlock to mutex-use the buffer pool. They use
spinAcquire and SpinRelease to acquire and release the lock. After the
engine acquires the lock, if the I/O process needs the lock,it has to
wait and enter suspended state. When the engine releases the lock, the
I/O process seems to remain suspended.
	Do semaphores and spinlock have the functions. If one process is
blocked by the lock or semaphore, when the lock is released, is the
process be activated automatically by os?
Thanks in advances!
SQYang



Message-ID: <36620643.1FE37641@nudt.edu.cn>
Permalink:  ../36620643.1FE37641@nudt.edu.cn/
Also on:    postgresql.org/message-id/36620643.1FE37641@nudt.edu.cn

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: sqyang@nudt.edu.cn
  Subject: Re: the differences between semaphores and spinlocks
  In-Reply-To: <36620643.1FE37641@nudt.edu.cn>
  References: <36620643.1FE37641@nudt.edu.cn>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox