acltdtDequeue

Description

Obtains data from a queue. This API is synchronous.

The Ascend 310 AI Processor does not support this API in the current version.

The Ascend 910 AI Processor does not support this API in the current version.

The Ascend 310P AI Processor does not support this API in the current version.

Prototype

aclError acltdtDequeue(uint32_t qid, acltdtBuf *buf, int32_t timeout)

Parameters

Parameter

Input/Output

Description

qid

Input

Queue from which data is obtained.

You must call acltdtCreateQueue to create a queue in advance.

buf

Output

Pointer to the shared buffer.

timeout

Input

Wait timeout interval. If data is obtained from an empty queue, the system determines how to process the data based on the configured wait timeout interval.

The values are as follows:
  • -1: blocking mode. The system waits until the queue is not empty.
  • 0: non-blocking mode. When the queue is empty, the error indicating that the queue is empty is returned. In this case, the retry interval can be set by the user.
  • > 0: specified timeout interval, in ms. When the queue is empty, an error is returned after the timeout interval has elapsed. The timeout interval varies with the operating system. The deviation is generally within a time slice of an operating system. For example, if the time slice of an operating system is 4 ms and the value of wait timeout interval is set to 1 ms, the actual timeout interval ranges from 1 ms to 5 ms. When the CPU load is high, the timeout interval may fluctuate.

Returns

0 on success; else, failure.