Re: [HACKERS] Cancell/OOB over a Unix Domain Socket

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: cobrien(at)access(dot)digex(dot)net (Cary B(dot) O'Brien)
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] Cancell/OOB over a Unix Domain Socket
Date: 1998-05-19 19:36:30
Message-ID: 199805191936.PAA21776@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Think..Think..Think..
>
> If the notification has to be a signal, it has to come from a process
> with the same pid (or running as root). That means another processes,
> perhaps listening to another socket. To interrupt the user process
> connects to the other (Unix domain) socket, sends some sort of cancell
> id, and closes. The signaller process then signalls the backend. Ugly.

Yep.

>
> Hmm... The postmaster is still hanging around, isn't it. So to cancel
> you make another identical connection to the postmaster and send a different
> code. A bit less ugly.

Yep.

>
> Is the cancell flag in shared memory? The postmaster could set it directly
> without the signal() call. In fact, if it were in shared memory the
> postmaster could take a peek and see how much of the query was completed,
> if some sort of counter was maintained.

Shared memory really doesn't buy us much. If we have privs to attach to
shared memory, we have enough to send a signal, and because it just
needs to tell it to stop, extra bandwidth of shared memory isn't buying
us anything. In fact, it could make it worse, because we would have to
synchronize access to the shared memory.

>
> Wish I could come up with something better. Another example of the
> fact that our beloved operating system does indeed have a few warts.

I am still looking for that silver bullet.

--
Bruce Momjian | 830 Blythe Avenue
maillist(at)candle(dot)pha(dot)pa(dot)us | Drexel Hill, Pennsylvania 19026
+ If your life is a hard drive, | (610) 353-9879(w)
+ Christ can be your backup. | (610) 853-3000(h)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Richards 1998-05-20 00:02:38 Re: [HACKERS] sorting big tables :(
Previous Message Bruce Momjian 1998-05-19 19:33:03 Re: [HACKERS] Query cancel and OOB data