acltdtGrantQueue

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

Description

Grants queue-related permissions to processes, such as enqueue and dequeue when the processes need to share queue information.

Restrictions

Users need to ensure the security when queue-related information is transferred between processes.

Prototype

aclError acltdtGrantQueue(uint32_t qid, int32_t pid, uint32_t permission, int32_t timeout)

Parameters

Parameter

Input/Output

Description

qid

Input

Queue ID.

pid

Input

ID of the authorized process.

permission

Input

Permission ID (queue producer/consumer).

Logically ORed of the following macros (for example, ACL_TDT_QUEUE_PERMISSION_DEQUEUE | ACL_TDT_QUEUE_PERMISSION_ENQUEUE). Each macro corresponds to a specific permission.

  • ACL_TDT_QUEUE_PERMISSION_MANAGE: queue management permission.
  • ACL_TDT_QUEUE_PERMISSION_DEQUEUE: dequeue permission.
  • ACL_TDT_QUEUE_PERMISSION_ENQUEUE: enqueue permission.

timeout

Input

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. Data is returned immediately.
  • > 0: configures specific timeout interval, in ms. An error is returned after the timeout interval has reached. 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

The value 0 indicates success, and other values indicate failure. For details, see aclError.