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

Re: Win32 semaphore patch

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>,<pgsql-patches(at)postgresql(dot)org>
Subject: Re: Win32 semaphore patch
Date: 2006-04-20 18:26:44
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0F923@algol.sollentuna.se (view raw or flat)
Thread:
Lists: pgsql-patches
> > For #2, yes, the semaphores will go away when the last 
> process holding 
> > a HANDLE to it goes away.
> 
> Well, that raises an interesting point: exactly where in this 
> code does ownership of the HANDLEs get propagated to the 
> child processes?  As written, the HANDLEs seem to belong only 
> to the postmaster --- will the kernel calls even work in the 
> child processes?  According to what someone was telling me 
> the other day, HANDLEs are process-local, so just storing 
> them in shared memory doesn't seem like it should work.

They're inherited down. I haven't looked at the calling path, but if
they're all created in the postmaster *before* the backends are forked,
it's not a problem. The code specifically sets them to inheritable, and
if you do that you can use them in a child process.

//Magnus

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2006-04-20 18:36:56
Subject: Re: Win32 semaphore patch
Previous:From: Tom LaneDate: 2006-04-20 18:20:07
Subject: Re: Win32 semaphore patch

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