ServiceLoop() Revisited

From: Per Bojsen <bojsen_at_.....>
Date: Thu Apr 14 2005 - 10:24:47 PDT
Hi,

I apologize for bringing this up again especially now that 1.1 has
been approved, but I'm just looking for a quick answer to the
following question regarding ServiceLoop() and the g() function.  I
don't remember if we covered this particular facet in our previous
ServiceLoop() discussions and I missed it when reviewing the
pseudo code for ServiceLoop() that John contributed.  Anyway, the
pseudo code shows ServiceLoop() as having two internal disjoint
loops: one over pending input messages and one over what we called
service requests (pending output messages and input-ready notifications).
The g() function is only invoked in the second loop.

Now, assume an implementation which only transfers input messages in
ServiceLoop(), i.e., Send() just queues messages on the software side.
I believe the spec allows this, correct?  This means, that as long
as g() returns 1, ServiceLoop() stays in the second loop and no input
messages will get transferred.  g() must return 0 at some point to
cause ServiceLoop() to kick out and the application must ensure
ServiceLoop() gets called again to get any new input messages to
transfer.  Is this correct, or am I missing something?

I have seen several examples of users assuming g() could be used in
a mode where it returns 1 until the test is done at which time g()
returns 0.  So the assumption is that the whole test will invoke
ServiceLoop() exactly once and g() will cause ServiceLoop() to stay
looping internally until the test is done.  This usage model seems
to conflict with the pseudo code in the spec (unless, of course,
the test only sends a few messages at the beginning before ServiceLoop()
is invoked).

Long story short: Is the above use model invalid or is the pseudo
code wrong or did I miss something?

Thanks,
Per

-- 
Per Bojsen                                Email: <bojsen@zaiqtech.com>
Zaiq Technologies, Inc.                   WWW:   http://www.zaiqtech.com
78 Dragon Ct.                             Tel:   781 721 8229
Woburn, MA 01801                          Fax:   781 932 7488
Received on Thu Apr 14 10:19:43 2005

This archive was generated by hypermail 2.1.8 : Thu Apr 14 2005 - 10:20:19 PDT