Article View: comp.soft-sys.andrew
Article #1784Re: message queue with ATK
From: Todd Inglett
Date: Wed, 18 Nov 1992 14:48
Date: Wed, 18 Nov 1992 14:48
39 lines
2408 bytes
2408 bytes
Excerpts from ext.misc.info-andrew: 17-Nov-92 Re: messagequeue with ATK
Zalman Stern@decwrl.dec. (1573)
> The namespace for System V message queues is disjoint from the file
> descriptor namespace. They do not work with select and hence donot fit into
ATK interaction model.
This may be true in general, but be sure to look closely at the
selectcall on your system. In AIX, for example, the first argument to
selectindicates how many file descriptors and message queues are
specified in theother arguments. The lower 16 bits of the first
argument specify the # offiles and the upper 16 bits specify the # of
message queues. Because it wouldbe impossible to specify 64535 file
descriptors (AIX has a limit of around2000 or so), it is completely
compatible with the `old' select.
Still, this means that you must modify ATK at a very low level.
Inparticular, you must add at least two new class procedures
toatk/basics/common/im.ch and their implementations in im.c:
AddMsgQHandler(int msgqid, procedure proc, char *procdata,
longpriority) returns boolean;
RemoveMsgQHandler(int msgqid);
You will have to add an array of MsgQHandlers to the struct
im_GlobalDataType(scroll down in im.ch), and write the two new class
procedures to add/removethe handlers from this MsgQHandlers list.
Finally, you must modifyxim__HandleFiles in atk/basics/x/xim.c so that
the select system callis given the appropriate arguments. This code is
a little tricky, but with alittle persistence I am sure you can get it
to work.
Now your ADEW application can call im_AddMsgQHandler to setup acallback
whenever input arrives from the queue. But remember, this will onlywork
if your select supports both queues and file descriptors. Ifyour select
doesn't support message queues, how about the poll systemcall (if you
have one)? It could be used in place of select.
-todd inglett
Technical Details
Message-ID:
<gf2ZSdw91Jbd17dlp5@rchland.ibm.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!ucbvax!rchland.ibm.com!tinglett+References:
<1992Nov17.234622.5623@adobe.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!ucbvax!rchland.ibm.com!tinglett+ From: tinglett+@rchland.ibm.com (Todd Inglett) Newsgroups: comp.soft-sys.andrew Subject: Re: message queue with ATK Message-ID: <gf2ZSdw91Jbd17dlp5@rchland.ibm.com> Date: 18 Nov 92 14:48:09 GMT References: <1992Nov17.234622.5623@adobe.com> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: "Todd Inglett" <tinglett@vnet.ibm.com> Distribution: world Organization: The Internet Lines: 39