Hi,
I'm sorry, but I have to bring the issue of recursion of
ServiceLoop() up again. In our discussion at the last meeting we
did not discuss what happens with the g() function and the
pending flag in a scenario where ServiceLoop() is recursively
called. It may be easiest to separate the analysis in two cases:
1) Recursion due to Receive() and IsReady()
2) Recursion due to g()
Note, the user is free to use different g() on each (recursive and
non-recursive) call of g().
In case 1 suppose an output message or input-ready notification
is seen, i.e., the pending flag will become 1. Suppose that
the Receive() or IsReady() callback that the service request
triggers will call ServiceLoop() recursively, and that there are
no more service requests from the hardware side. Now, what should
pending flag be for the second, recursive invocation of
ServiceLoop()? Somehow it feels reasonable that it should be
0/false since that invocation of ServiceLoop() did not actually
process any requests. Once this invocation returns, the g()
function called by the outer ServiceLoop() invocation will see
pending as 1. This has the possibly surprising consequence
that the inner g() which is called before the outer g() does
not see any pending messages.
In case 2, the outer g() is called first, so it sees pending
1 first. In this case it seems even more reasonable that
the recursive ServiceLoop should pass pending 0 to the inner
g().
What does the committee think?
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 7488Received on Tue Apr 27 20:11:47 2004
This archive was generated by hypermail 2.1.8 : Tue Apr 27 2004 - 20:11:48 PDT