---
title: Create
framework: kernel
role: symbol
role_heading: Type Method
path: kernel/iodataqueuedispatchsource/3438177-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](kernel/iodataqueuedispatchsource/3438187-init.md)
- [free](kernel/iodataqueuedispatchsource/3438186-free.md)
