---
title: CMSimpleQueue
framework: coremedia
role: collectionGroup
role_heading: API Collection
path: coremedia/cmsimplequeue-api
---

# CMSimpleQueue

A simple, lockless FIFO queue of elements.

## Overview

Overview Simple queues are Core Foundation-based objects that implement a simple, lockless FIFO queue of (void *) elements. The elements in the queue can be pointers or simple pointer-sized numeric values (NULL or 0 elements aren’t allowed). If the elements are pointers to allocated memory buffers, handle lifetime management externally. A simple queue can safely handle one enqueueing thread and one dequeueing thread. Simple queues are lockless, so enqueues and dequeues can occur on the Core Audio ioProc thread, where the system forbids locking and blocking. You can query the state of a simple queue to get the current number of elements and the maximum capacity of the queue. You can also determine the queue’s fullness, which the system provides as a percentage of its capacity. You can reset a simple queue, which returns it to its newly created state, with no elements in the queue (but with the maximum capacity unchanged).

## Topics

### Creating a Queue

- [CMSimpleQueueCreate(allocator:capacity:queueOut:)](coremedia/cmsimplequeuecreate(allocator:capacity:queueout:).md)

### Managing Queues

- [CMSimpleQueueEnqueue(_:element:)](coremedia/cmsimplequeueenqueue(_:element:).md)
- [CMSimpleQueueDequeue(_:)](coremedia/cmsimplequeuedequeue(_:).md)
- [CMSimpleQueueReset(_:)](coremedia/cmsimplequeuereset(_:).md)

### Inspecting Queues

- [CMSimpleQueueGetHead(_:)](coremedia/cmsimplequeuegethead(_:).md)
- [CMSimpleQueueGetCapacity(_:)](coremedia/cmsimplequeuegetcapacity(_:).md)
- [CMSimpleQueueGetCount(_:)](coremedia/cmsimplequeuegetcount(_:).md)

### Accessing the Type Identifier

- [CMSimpleQueueGetTypeID()](coremedia/cmsimplequeuegettypeid().md)

### Data Types

- [CMSimpleQueue](coremedia/cmsimplequeue.md)

### Errors

- [Simple Queue Error Codes](coremedia/simple-queue-errors.md)

## See Also

### Queues

- [CMBufferQueue](coremedia/cmbufferqueue-api.md)
- [CMMemoryPool](coremedia/cmmemorypool-api.md)
