From: | "Magnus Hagander" <mha(at)sollentuna(dot)net> |
---|---|
To: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
Cc: | <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Win32 semaphore patch |
Date: | 2006-04-20 18:09:49 |
Message-ID: | 6BCB9D8A16AC4241919521715F4D8BCEA0F920@algol.sollentuna.se |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
> > Attached is a patch for Win32 semaphore reimplementation per
> > discussion with Tom and Magnus.
>
> The trickiest part of the sysv and posix implementations is
> making sure that any kernel resources represented by the
> semaphores will go away at appropriate times. There are two
> cases to worry about:
>
> 1. Backend crash while postmaster stays alive: postmaster
> will get to execute the on_shmem_exit() callback after all
> the backends are gone, and that can clean 'em up.
>
> 2. postmaster crashes: we'd like the semas to go away
> automatically when the last backend goes away. If this
> doesn't happen, then there has to be logic to recycle
> leftover semas when the postmaster is next started.
>
> Most of the ugliness in sysv_sema.c is because it has to do "manual"
> cleanup per #2.
>
> I dunno much about Windows, and it may be that your code is
> already OK on this score. I'm just pointing it out as
> something that has to be considered. Some comments in the
> code about how this works wouldn't be a bad idea.
For #2, yes, the semaphores will go away when the last process holding a
HANDLE to it goes away. For #1, the code seems to handle that right?
//Magnus
From | Date | Subject | |
---|---|---|---|
Next Message | David Wheeler | 2006-04-20 18:17:19 | Re: Suggestion: Which Binary? |
Previous Message | Tom Lane | 2006-04-20 16:27:50 | Re: Win32 semaphore patch |