---
title: Create
framework: driverkit
role: symbol
role_heading: Static Method
path: driverkit/iodataqueuedispatchsource/create
---

# Create

Creates a dispatch source that you use as a shared-memory data queue.

## Declaration

```occ
static kern_return_t Create(uint64_t queueByteCount, IODispatchQueue *queue, IODataQueueDispatchSource **source);
```

## Parameters

- `queueByteCount`: The size of the queue in bytes.
- `queue`: The dispatch queue to use for executing tasks. Note that the doc://com.apple.driverkit/documentation/DriverKit/IODataQueueDispatchSource/DataAvailable and doc://com.apple.driverkit/documentation/DriverKit/IODataQueueDispatchSource/DataServiced handlers execute on the queue set for the target method of the associated doc://com.apple.driverkit/documentation/DriverKit/OSAction object, not this queue.
- `source`: A variable for storing the resulting dispatch source object. On success, the returned object has a retain count of 1, and you must release it when finished.

## Return Value

Return Value kIOReturnSuccess on success, or another value if an error occurs. See Error Codes.

## See Also

### Configuring the Dispatch Source

- [init](driverkit/iodataqueuedispatchsource/init.md)
- [free](driverkit/iodataqueuedispatchsource/free.md)
