[comp.sys.isis] replying to unsent messages

rich@sendai.sendai.ann-arbor.mi.us (K. Richard Magill) (03/12/90)

What happens if I reply to a message that was never sent?

I have a task that ordinarily bcasts to another task in the same
process.  For the time being, I want to skip the actual bcast and task
dispatch.  Instead, I msg_gen my message, call the second task
directly, and then msg_delete my message.  What happens if the second
task reply(m, "")'s?

ken@gvax.cs.cornell.edu (Ken Birman) (03/13/90)

In article <RICH.90Mar12051959@sendai.sendai.ann-arbor.mi.us> rich@sendai.ann-arbor.mi.us writes:
>What happens if I reply to a message that was never sent?
>
>I have a task that ordinarily bcasts to another task in the same
>process.  For the time being, I want to skip the actual bcast and task
>dispatch.  Instead, I msg_gen my message, call the second task
>directly, and then msg_delete my message.  What happens if the second
>task reply(m, "")'s?

This should work: the reply() routine ignores messages that have
no message-id in them, and yours won't because it was never broadcast.
However, be sure to use t_fork_msg(routine,mp) to fork off the
task that will handle this, or call the routine directly.  If you
use t_fork, there may be problems with the message reference counter.

Ken

PS: If the message actually had an id, say if you send too many replies
to a multicast, extra replies are discarded silently.