Re: Can we simplify win32 threading code - Mailing list pgsql-hackers

From Qingqing Zhou
Subject Re: Can we simplify win32 threading code
Date
Msg-id d7636u$eph$1@news.hub.org
Whole thread Raw
In response to Re: Can we simplify win32 threading code  ("Magnus Hagander" <mha@sollentuna.net>)
List pgsql-hackers
""Magnus Hagander"" <mha@sollentuna.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().




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: A 2 phase commit weirdness
Next
From: "Qingqing Zhou"
Date:
Subject: Re: Can we simplify win32 threading code