Re: Can we simplify win32 threading code

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Can we simplify win32 threading code
Date: 2005-05-27 03:10:26
Message-ID: d7636u$eph$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


""Magnus Hagander"" <mha(at)sollentuna(dot)net> writes
>
> Yeah, that should work. With one shared memory segment and one event for
> each process, of course. The event can be the same one as is used now,
> only it has to be named so it can be accessed externally.
>

Yes, the shared memory segment size could be controlled by MaxBackends.

> It would do away with the thread, certainly. But it's not quite as
> simple as you outline above - you'll need to replace the critical
> section locking (easy, lightweight) with a mutex or something like that
> (more complex, more heavy weight). But probably named pipes is more
> heavy, yes.
>

Yes, use mutex.

> You'll also need some way of delivering the feedback, I think - kill(0)
> is supposed to tell you if there is a live process in th eother end, so
> you can't just throw the signal out and hope for the best.
>

To simulate kill(0) we can test the process handle, just like we handle
waitpid().

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Qingqing Zhou 2005-05-27 03:22:10 Re: Can we simplify win32 threading code
Previous Message Tom Lane 2005-05-27 03:09:28 Re: A 2 phase commit weirdness