acltdtEnqueue

Applicable Products

Product

Supported

Ascend 950PR/Ascend 950DT

☓

Atlas A3 training products/Atlas A3 inference products

☓

Atlas A2 training products/Atlas A2 inference products

☓

Atlas 200I/500 A2 inference products

☓

Atlas inference products

☓

Atlas training products

☓

Function

Adds data to a queue. The buffer for storing data must be allocated by calling acltdtAllocBuf.

Prototype

1
aclError acltdtEnqueue(uint32_t qid, acltdtBuf buf, int32_t timeout)

Parameters

Parameter

Input/Output

Description

qid

Input

Queue to which data is to be added.

You must call acltdtCreateQueue to create a queue in advance.

buf

Input

Pointer to the shared buffer. For details about the type definition, see acltdtBuf.

You must call acltdtAllocBuf in advance to allocate the buffer.

timeout

Input

Wait timeout interval. If data is added to a full queue, the system determines how to process the data based on the configured wait timeout interval.

The options are as follows:
  • -1: blocking mode. The system waits until data is successfully added to the queue.
  • 0: non-blocking mode. When the queue is full, the error indicating that the queue is full is returned. In this case, the retry interval can be set by the user.
  • > 0: specified timeout interval, in ms. When the queue is full, 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 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; otherwise, failure. For details, see aclError.