IM06 Resolution

From: Stickley, John <john_stickley@mentorg.com>
Date: Thu Mar 11 2004 - 14:37:12 PST

SCE-MI Members,

Here is the suggested rewording of section 5.3.3.6 on the g() function as
per my action item for IM06:

--------------------------------------------------------------
Suggested re-wording for section 5.3.3.6

g()
If g is NULL, the SCE-MI checks for pending input or output message
transfers to be performed and dispatches them, returning immediately
afterwards. If g() is non-NULL, the SCE-MI enters a loop of performing
input or output message transfers but calling g() only for each output
message.

For purposes of discussions of the g() function in this section, "output
message" is considered to be one of the following:
  o An arriving message in a SCE-MI message output port that will result
    in a receive callback being called.
  o An input ready notification that will result in an input ready callback

    being called.

When g() returns 0, control returns from the loop. When g() is called, an
indication of whether there is at least one output message pending is made
with the pending flag. The context argument to g() is the pointer which is
passed as the context argument to ::ServiceLoop().

--------------------------------------------------------------
Suggested re-wording for section 5.3.3.6.1

Some applications force a return from the ::ServiceLoop() call after
processing each output message. The ::ServiceLoop() call always guarantees a

separate call is made to the g() function for each output message processed.

In fact, it is possible to force ::ServiceLoop() to return back to the
application once per output message by having the g() function return a 0.

So even if all g() does is return 0, as follows,

    int g( void */*context*/, bool /*pending*/ ){ return 0; }

the application forces a return from ::ServiceLoop() for each processed
output message. NOTE: In this case, the ::ServiceLoop() does not block
because it also returns even if no output message was found
(i.e., pending == 0 ). Basically ::ServiceLoop() returns no matter what
in this case with zero or one message.

--------------------------------------------------------------
Suggested re-wording for section 5.3.3.6.2

An application can use the g() function to put ::ServiceLoop() into a
blocking mode rather than its default polling mode. The g() function can
be written to cause ::ServiceLoop() to block until it gets one output
message, then return on the message it received. This is done by making
use of the pending argument to the g() function.

This argument simply indicates if there is an output message to be
processed or not, for example:

    int g( void */*context*/, bool pending ){
        return pending == true ? 0 : 1 }

This g() function causes ::ServiceLoop() to block until the next output
message occurs, then returns on processing the first message
(i.e. calling its associated callback).

--------------------------------------------------------------
Suggested re-wording for section 5.3.3.6.3 - first sentence

Alternatively, suppose the application wants ::ServiceLoop() to block until
at least one output message occurs, then return only after all the currently

pending output messages have been processed.
Received on Thu Mar 11 14:37:19 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 11 2004 - 14:37:24 PST