<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "os",
  "identifier" : "/documentation/os/os_workgroup_interval_start",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "c:@F@os_workgroup_interval_start"
  },
  "title" : "os_workgroup_interval_start"
}
-->

# os_workgroup_interval_start

Starts the regular execution of the workgroup’s threads at the specified time.

```
extern int os_workgroup_interval_start(os_workgroup_interval_t wg, uint64_t start, uint64_t deadline, os_workgroup_interval_data_t data);
```

## Parameters

`wg`

A workgroup containing one or more threads, including the current thread. If the current thread is not part of this workgroup, this function aborts the process.

`start`

The time at which your thread started the work associated with the current deadline. Specify this value using the time units of the workgroup. For a list of possible time units, see [`os_clockid_t`](/documentation/os/os_clockid_t).

`deadline`

The ideal time at which you expect the threads to complete the task for the current interval. The system uses this parameter to assess whether your threads finish early, on-time, or later than expected. Specify this value using the time units of the workgroup. For a list of possible time units, see [`os_clockid_t`](/documentation/os/os_clockid_t). This value must be greater than the value in the `start` parameter.

`data`

Additional interval data. Specify `NULL` for this parameter.

## Return Value

A value of `0` on success, or a nonzero error code indicating why the function failed. Common error codes include `EINVAL` or `EPERM`. For example, this method returns `EINVAL` if you previously started or canceled the workgroup.

## Discussion

Join all threads to the workgroup before calling this function, and start each thread working on the target task. Call this function from only one of the threads to mark the start of the task and to set the target deadline. When your threads finish the current task, call [`os_workgroup_interval_update`](/documentation/os/os_workgroup_interval_update) to begin the next interval-based task. When the threads finish with the overall task, call [`os_workgroup_interval_finish`](/documentation/os/os_workgroup_interval_finish) to let the system know that your threads are done with their interval-based work.

You must balance each call to this function with a call to [`os_workgroup_interval_finish`](/documentation/os/os_workgroup_interval_finish) at some point. In between, you may call [`os_workgroup_interval_update`](/documentation/os/os_workgroup_interval_update) as many times as you like to update the current interval deadline. For example, you might call [`os_workgroup_interval_update`](/documentation/os/os_workgroup_interval_update) at least once every 16.6 milliseconds when decoding video for playback.

This function returns an error if you created the workgroup using the [`os_workgroup_create_with_workgroup`](/documentation/os/os_workgroup_create_with_workgroup) or [`os_workgroup_create_with_port`](/documentation/os/os_workgroup_create_with_port) function. This function works only on workgroups that you create using the `os_workgroup_interval_create` function.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)