Re: [HACKERS] Semaphores - Mailing list pgsql-general

From Bruce Momjian
Subject Re: [HACKERS] Semaphores
Date
Msg-id 200310241549.h9OFn6u01994@candle.pha.pa.us
Whole thread Raw
In response to Semaphores  (Nailah Ogeer <ogeer@cs.queensu.ca>)
List pgsql-general
Nailah Ogeer wrote:
> Hi all,
> Just wanted to know how postgres handles semaphores. Was hoping that i can
> can use the locks defined in lwlock.h and lwlock.c . If i create a new
> lock and then use LockAcquire and
> LockRelease when I want a process to start and stop will this work?

Uh, well, we usually try to get a lock via a test-and-set assembly
language call into shared memory, and if we fail, we then get a
semaphore and wait for someone to wake us up.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-general by date:

Previous
From: Network Administrator
Date:
Subject: Re: HTML generation with PL/PgSQL
Next
From: Scott Chapman
Date:
Subject: [OT] Choosing a scripting language.