From: Igartua Jose <R12270%UQAM.bitnet@CUNYVM.CUNY.EDU>
Subject: Front end - back end ^C
Organization: National Radio Astronomy Observatory
Date: Thu, 15 Oct 1992 21:12:53 GMT

This is from Michel Hubert, whose address is at the end of the message. JI.
	Pourrais-tu faire parvenir ce texte a la liste
------------

To Chris Davies and others with same interest.

How to interrupt an INGRES task without breaking
the front-end/back-end link or without hanging.

First we must find out the front-end/back-end communication
mecanism. On a VAX/VMS system this communication is by
way of four mailboxes: one for establishing communication,
one for the front-end output to the back-end, one for
the front-end input from the backend and
the last one asks attention for interrupt. A fifth
mailbox is also open but does not serve any noticable purpose.
Using analyse/system and checking active channels for a process
you can see for a front-end a sequence like this:

sda> show proc/chan
                            Process active channels
                            -----------------------
Channel	 Window		  Status	Device/file accessed
-------	 ------		  ------	--------------------
  0120	00000000	          	MBA39:

     list of the communication mailboxes----+
                                            v
  01D0	00000000	          	MBA1386:
  0210	00000000	          	MBA1387:
  0220	00000000	          	MBA1388:
  0230	00000000	          	MBA1389:

---------------------------------------------------------------------------
MBA39: Startup communication with the server, only one message
is sent, the first of all. It sends the four mailboxes definition to
the server to establish the front-end/back-end communication.
---------------------------------------------------------------------------
MBA1386: (the first of mailbox of the list) is the input to messages coming
from the server (gca_receive). It receives message types as GCA_ACCEPT,
GCA_TDESC, GCA_TUPLES, GCA_RESPONSE, GCA_QC_ID, GCA_TRACE, GCA_IACK ...

MBA1387: (the second mailbox) is the output to messages going to the
server (gca_send) . It sends messages types as GCA_QUERY, GCA_COMMIT,
GCA_RELEASE, GCA_DEFINE, CGA_INVOKE...

MBA1388: (the third mailbox) has no practical use.

MBA1389: (the fourth mailbox) is the Attention mailbox. It sends and only sends
a GCA_ATTENTION message. The front-end will receive in response a GCA_IACK
(Interrupt ACKnowledgement) trough the first mailbox MBA1386.
-------------------------------------------------------------------------------

The attention message has the definition:
	structure message
	   word     code1
	   word     gca_association_id
	   longword gca_message_type
	   longword gca_header_length
	   longword gca_data_length
	   longword gca_end_of_data
	   longwords i4buff6,i4buff7,i4buff8,i4buff9
	end stucture
	parameter gca_attention='00000013'x

	message.code1			='05C0'x
	message.gca_association_id	='0000'x
	message.gca_message_type	=gca_attention
	message.gca_header_length	='00000014'x
	message.gca_data_length		='00000004'x
	message.gca_end_of_data		='00000001'x
	message.i4buff9			='00000000'x

The acknowlegement message has a message.gca_message_type of 'gca_iack' where
gca_iack egals '00000020'x.

Grosso modo steps to be followed are:
1- Escape program execution.
2- Find the four communication mailboxes and identify the input mailbox and
the attention mailbox. Those are the first and the fourth in a VAX/VMS system.
3- Send a GCA_ATTENTION message in the attention mailbox.
4- Check the GCA_IACK response in the input mailbox.
5- Return to program execution.

Michel Hubert  (system analyst) <saguenay@uquebec.ca>
Newsgroups: comp.databases.ingres