Re: [HACKERS] Can we simplify win32 threading code

2005-06-01 Thread Qingqing Zhou
""Magnus Hagander"" <[EMAIL PROTECTED]> > > Why not just use the pid in teh name, and have one segment > > per backend? > > > > Being used only for signals you mean? That might work. > > That was my idea. We'll end up using three global namespace objects > (mutex+event+shared memory) instead of

Re: [HACKERS] Can we simplify win32 threading code

2005-06-01 Thread Magnus Hagander
> > Why not just use the pid in teh name, and have one segment > per backend? > > Being used only for signals you mean? That might work. That was my idea. We'll end up using three global namespace objects (mutex+event+shared memory) instead of one (named pipe), but as we're not talking thousand

Re: [HACKERS] Can we simplify win32 threading code

2005-06-01 Thread Tom Lane
"Magnus Hagander" <[EMAIL PROTECTED]> writes: > Why not just use the pid in teh name, and have one segment per backend? Being used only for signals you mean? That might work. I dislike fooling around with the contents of postmaster.pid, as that will inject platform-specific code into places wher

Re: [HACKERS] Can we simplify win32 threading code

2005-06-01 Thread Magnus Hagander
> I have simplified the code according to the discussion. Now > there is no pipe or signaling threads, process access shared > memory directly to pass signals. > Seems everything works fine except pg_ctl. I now have two > choices to fix it: > > (1) Record Shared memory name (it is already there

Re: [HACKERS] Can we simplify win32 threading code

2005-05-31 Thread Qingqing Zhou
I have simplified the code according to the discussion. Now there is no pipe or signaling threads, process access shared memory directly to pass signals. Seems everything works fine except pg_ctl. I now have two choices to fix it: (1) Record Shared memory name (it is already there) and the offset

Re: [HACKERS] Can we simplify win32 threading code

2005-05-27 Thread Qingqing Zhou
""Magnus Hagander"" <[EMAIL PROTECTED]> writes > > It may not be necessary at all. But what I meant is I don't know what > the default permissinos ar eon a shared mem/event object in the global > namespace. On the naemd pipe it's "creator/owner full" (so the postgres > account itself can issue ki

Re: [HACKERS] Can we simplify win32 threading code

2005-05-27 Thread Magnus Hagander
> > > I assume that this will not break the use of pg_ctl to deliver > > > pseudo-signals. That would be a show-stopper. > > > > It shouldn't, but there is one concern: it has to be created in the > > global namespace. On older windows there is no different, but on > > modern windows with termin

Re: [HACKERS] Can we simplify win32 threading code

2005-05-26 Thread Qingqing Zhou
""Magnus Hagander"" <[EMAIL PROTECTED]> writes > > I assume that this will not break the use of pg_ctl to > > deliver pseudo-signals. That would be a show-stopper. > > It shouldn't, but there is one concern: it has to be created in the > global namespace. On older windows there is no different, bu

Re: [HACKERS] Can we simplify win32 threading code

2005-05-26 Thread Qingqing Zhou
""Magnus Hagander"" <[EMAIL PROTECTED]> 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 co

Re: [HACKERS] Can we simplify win32 threading code

2005-05-26 Thread Magnus Hagander
> >>(*) the process who kill the signal: > >> - put the signal in a *shared memory variable > >>pg_signal_queue* and > >>SetEvent(*shared_memory_event_variable*), then it is done; > >> > >>(*) the process who should receive the signal: > >> - the main thread of this process could be awakened by the

Re: [HACKERS] Can we simplify win32 threading code

2005-05-26 Thread Andrew Dunstan
Magnus Hagander wrote: (*) the process who kill the signal: - put the signal in a *shared memory variable pg_signal_queue* and SetEvent(*shared_memory_event_variable*), then it is done; (*) the process who should receive the signal: - the main thread of this process could be awakened by th

Re: [HACKERS] Can we simplify win32 threading code

2005-05-26 Thread Magnus Hagander
> Currently PG win32 port mainly does the following to simulate signals: > > (*) the process who kill the signal: > - put the signal in a named pipe, then it is done; > > (*) the process who should receive the signal: > - a non-stop thread "pg_signal_thread" will read the signal > from the pip

[HACKERS] Can we simplify win32 threading code

2005-05-25 Thread Qingqing Zhou
Currently PG win32 port mainly does the following to simulate signals: (*) the process who kill the signal: - put the signal in a named pipe, then it is done; (*) the process who should receive the signal: - a non-stop thread "pg_signal_thread" will read the signal from the pipe, and start anot