Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!tness7!tness1!nuchat!sugar!peter
From: peter@sugar.UUCP (Peter da Silva)
Newsgroups: comp.sys.amiga.tech
Subject: Re: IPCMessages -- A Prototype
Keywords: IPC, standard, BADGE
Message-ID: <2275@sugar.UUCP>
Date: 9 Jul 88 00:08:14 GMT
References: <6306@well.UUCP> <2139@sugar.UUCP> <6338@well.UUCP> <2158@sugar.UUCP> <6467@well.UUCP>
Organization: Sugar Land UNIX - Houston, TX
Lines: 61

In article <6467@well.UUCP>, shf@well.UUCP writes:
> Well, the "cmd" argument cannot be ignored so easily.  It's actually a
> pointer to a struct containing not only the method code, but any
> arguments that method requires, since most commands are more than just a
> single code.  For example, if you want to tell a bitmap to `SHOW'
> itself, you also have to tell it _how_ to show itself. 

OK. I got the impression this stuff was in the object. Silly me.

> | [ object servers that aren't seperate processes ]

> This is a *neat* idea.  I'm not really sure how to do something like
> this, but it sounds great!  Of course, everything can be done with IPC,
> but sometimes using IPC for relatively simple things seems like
> overkill.  Got more details on what you're thinking of here, Peter? 

Off the top of my head:

You have a routine in your program, or [more likely] in from a library
You call "DeclareServerRoutine(command, class, routine, priority)". When you
try to send a message to a routine, it uses this subject to the priority:

	Priority < 0	-- Use message server if available (the "default"
			   routine).
	Priority > 0	-- Use routine unconditionally (the "override"
			   routine).
	Priority = 0	-- This is the ultimate default routine.

I don't know any other meaningful priorities, but you might as well use all
the bits.

Then when you call Dispatch(), it searches your queue for hipri servers, then
the message ports, then your queue again for lopri servers (this can be
optimised by putting the queue in order). If all else fails it calls the
0 priority routine.

If the routine is used, it's called with the object and command arguments
from Dispatch(). Normally this routine will just return "server not found",
but you can use it to gateway to an alternate server.

> I've added some OOIPC specific fields to the standard part of the
> message, and I've made items simpler by eliminating most of
> the flag bits.  The message format is something like this: 

[ Basically looks like a PPIPC message with an extra pair of fields: an
  object and an alias ]

Why pass the object in the call to Dispatch *and* in the command itself?
Otherwise, the structures are close enough for government work.

I'm also not sure about the purpose of the "alias". Could you be more specific?

> By allowing `data' to point to an object, most of the flag bits under 
> PPIPC become unnecessary.  If something has a complex behavior, that can 
> be encoded into its methods if it's an object.

That's cool. Got to worry about server loops, though.
-- 
-- `-_-' Peter (have you hugged your wolf today?) da Silva.
--   U   Mail to ...!uunet!sugar!peter, flames to /dev/null.
-- "Running DOS on a '386 is like driving an Indy car to the Stop-N-Go"