From: | "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu> |
---|---|
To: | pgsql-patches(at)postgresql(dot)org |
Subject: | Re: Win32 semaphore patch |
Date: | 2006-04-21 02:47:48 |
Message-ID: | e29hb3$1kd1$1@news.hub.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
""Magnus Hagander"" <mha(at)sollentuna(dot)net> wrote
> >
> > 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.
> >
>
> 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?
>
I intentionally use *unnamed* semaphores to avoid these problems -- even if
the semaphores didn't go away (as Magus pointed out, if all processes can
exit gracefully, this won't happen), we won't worry about them -- Creating
semahpores will still succeed because there is no existent same named
semaphores will bother it.
Regards,
Qingqing
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2006-04-21 03:01:22 | Re: Win32 semaphore patch |
Previous Message | Tom Lane | 2006-04-20 18:36:56 | Re: Win32 semaphore patch |