Can we simplify win32 threading code

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

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 another thread "pg_signal_dispatch_thread", which puts the signal
in a local memory variable "pg_signal_queue" and
SetEvent(local_memory_event_variable);
- the main thread of this process could be awakened by the event from
waiting status(like semop()) or CHECK_FOR_INTERRUPTS() actively;

Could we simplify this process like this:

(*) 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 event from
waiting status(like semop()) or CHECK_FOR_INTERRUPTS() actively; -- there is
no other threads of this process;

Any show-stop reasons of not doing this?

Regards,
Qingqing

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2005-05-26 07:56:30 foreign keys and RI triggers
Previous Message Oliver Jowett 2005-05-26 05:30:27 Re: Implement support for TCP_KEEPCNT, TCP_KEEPIDLE, TCP_KEEPINTVL