
B–61863E–1/06
2. TASK CONTROL FUNCTION
PMC CONTROL SOFTWARE
79
(6) Specifying a received packet using a packet ID
When packets may be sent from multiple tasks, only a particular
packet may need to be received. To do this, an identifier called an
packet ID is used.
In the following example, tasks A, B, C, and D send packets to task
E, but task E only wants to receive the packet from task C.
In this case, task E specifies ID=12 at packet reception, since the
packet ID of task C is 12. Task E then waits for the reception of the
packet from task C. As a result, among the packets which have
already arrived, task E only receives the packet with the specified ID.
If 0 is specified as the packet ID at packet reception, all the packets
that have arrived are received by task E.
Task A
Send ID
10
ID 12
11
12
Task A
Task A
Task A
13
Task E
Recieve ID 12
(7) Using the mark function for distinguishing packets that have already
arrived
To distinguish packets that have already arrived from packets to
arrive, packets can be marked. First, packets are sent with no mark
attached.
When the system call, os_mark_pkt, is issued, all packets that have
already arrived are marked. When a packet is received, information
about whether the packet is marked is returned.
To reset a mark, use the system call, os_rmrk_pkt.
Since the number of times a mark is attached and removed to/from
packets is returned, the number of linked packets can also be
recognized.