- 47 -
4.1.7
Synchronization and Communication Function (Data Queue)
The data queue is a mechanism to perform data communication between tasks. In Figure 4.14, for example, task A can
transmit data to the data queue and task B can receive the transmitted data from the data queue.
Da
ta
Da
ta
Da
ta
Data
Data
Task B
Task A
Figure 4.14 Data queue
Data in width of 32 bits can be transmitted to this data queue.
The data queue has the function to accumulate data. The accumulated data is retrieved in order of FIFO
. However, the
number of data that can be accumulated in the data queue is limited. If data is transmitted to the data queue that is full of
data, the service call issuing task goes to a data transmission wait state.
There are following data queue service calls that are provided by the MR100 kernel.
•
Send to Data Queue(snd_dtq, tsnd_dtq)
The data is transmitted to the data queue. If the data queue is full of data, the task goes to a data transmission wait
state.
•
Send to Data Queue (psnd_dtq, ipsnd_dtq)
The data is transmitted to the data queue. If the data queue is full of data, the task returns error code without going
to a data transmission wait state.
•
Forced Send to Data Queue (fsnd_dtq, ifsnd_dtq)
The data is transmitted to the data queue. If the data queue is full of data, the data at the top of the data queue or
the oldest data is removed, and the transmitted data is stored at the tail of the data queue.
•
Receive from Data Queue (rcv_dtq, trcv_dtq)
The data is retrieved from the data queue. If the data queue has no data in it, the task is kept waiting until data is
transmitted to the data queue.
•
Receive from Data Queue (prcv_dtq,iprcv_dtq)
The data is received from the data queue. If the data queue has no data in it, the task returns error code without
going to a data reception wait state.
•
Reference Data Queue Status (ref_dtq,iref_dtq)
Checks to see if there are any tasks waiting for data to be entered in the target data queue and refers to the number
of the data in the data queue.
22
First In First Out