RE: IM33: Modifying and/or sending messages received

From: Russell Vreeland <vreeland@broadcom.com>
Date: Thu Nov 04 2004 - 15:37:17 PST

Hello, ITC.

It surprised me that reuse of SceMiMessageData objects would be considered
an issue, since we've always constructed and reused them for sending through
InputPortProxys and I believe the spec adequately describes the limited
scope and lifetime of SceMiMessageData objects received through an
OutputPortProxy.

I would suggest, without any real fervor, that whether a user chooses to
construct once and store SceMiMessageData objects for use with an
InputPortProxy or "use once and discard" is an implementation detail best
left to the users and requires no further clarification. Since we're dealing
with a C++ class here, and we're passing it to Send() via a const reference,
the proposed clarification amounts to a C++ truism. That said, the only harm
the proposed language could do would be to add a little clutter to the spec.
The requirement that SceMiMessageData objects have the same width as the
ports they're sent to is addressed in the description of the constructor in
5.4.5.1

Changing subjects, after reading the spec some more, I found what might be a
separate issue. The CycleStamp() accessor for SceMiMessageData objects is
presented in the spec (p52, PDF 60) without any description of what would
happen if a renegade user were to call it on a SceMiMessageData object not
originating from an OutputPortProxy. Should the accessor call the port's
error handler in this case, return 0, or is "undefined behavior" adequate?

Cordially,
Russ

-----Original Message-----
From: owner-itc@eda.org [mailto:owner-itc@eda.org] On Behalf Of Bojsen, Per
Sent: Thursday, November 04, 2004 1:26 PM
To: 'itc@eda.org'
Subject: IM33: Modifying and/or sending messages received

Hi,

I took the action to check if the spec needs some language to clarify that
reusing SceMiMessageData objects and resending them is OK. The current spec
neither forbids nor explicitly allows this usage. This means it is likely
that different implementations will do different things and it would seem
useful to add clarifying language.

Send()

In Section 5.4.6.1, document p. 53, PDF p. 61, after the sentence under
`data' add:

  This object may be arbitrarily modified after Send() and used in
  an arbitrary number of Send() invocations to the same as well as
  other message ports as long as these all have the same width.

Receive()

In Section 5.4.7.1, document p. 55, PDF p. 63, after the last paragraph in
the section add:

  The class SceMiMessageData object passed to the receive callback may
  be sent any number of times to any number of input ports as long as
  the width of each of these ports is the same as the width of the
  output port causing the receive callback. Modifying the
  class SceMiMessageData object by casting away const leads to
  undefined behavior.

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 Nov 4 15:37:55 2004

This archive was generated by hypermail 2.1.8 : Thu Nov 04 2004 - 15:38:01 PST