<!--
{
  "documentType" : "article",
  "framework" : "os",
  "identifier" : "/documentation/os/workgroups",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Workgroups"
}
-->

# Workgroups

Schedule one or more threads to run at regular intervals and before specific deadlines.

## Discussion

A workgroup manages one or more threads that work cooperatively toward a common goal. Use workgroups to coordinate the efforts of threads that handle real-time audio work. Registering threads with a workgroup helps the system direct work to the right system resources, and also helps it manage the competing needs of low-power consumption with maximum rendering output.

## Topics

### Essentials

  <doc://com.apple.documentation/documentation/Apple-Silicon/tuning-your-code-s-performance-for-apple-silicon>

### Interval Tasks

  <doc://com.apple.documentation/documentation/Apple-Silicon/porting-your-audio-code-to-apple-silicon>

[`os_workgroup_interval_start`](/documentation/os/os_workgroup_interval_start)

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

[`os_workgroup_interval_update`](/documentation/os/os_workgroup_interval_update)

Schedules a new deadline for workgroup threads that run at regular intervals.

[`os_workgroup_interval_finish`](/documentation/os/os_workgroup_interval_finish)

Stops the current interval-based execution of the workgroup’s threads.

[`os_workgroup_interval_t`](/documentation/os/os_workgroup_interval_t)

A workgroup object that supports the scheduling of threads on a repeating cadence.

[`os_workgroup_interval_data_t`](/documentation/os/os_workgroup_interval_data_t)

An opaque structure that contains additional configuration data for the interval workgroup.

[`os_clockid_t`](/documentation/os/os_clockid_t)

Options for how to specify time-specific values in an interval workgroup.

### Parallel

[`os_workgroup_parallel_create`](/documentation/os/os_workgroup_parallel_create)

Creates a new workgroup that manges threads working on a single task in parallel.

[`os_workgroup_parallel_t`](/documentation/os/os_workgroup_parallel_t)

A workgroup object that supports the scheduling of threads that work in parallel to complete a task.

### Thread Attachment

[`os_workgroup_join`](/documentation/os/os_workgroup_join)

Adds the current thread to the specified workgroup.

[`os_workgroup_leave`](/documentation/os/os_workgroup_leave)

Removes the current thread from the workgroup it previously joined.

[`os_workgroup_join_token_t`](/documentation/os/os_workgroup_join_token_t)

An opaque token that represents a connection between a thread and a workgroup.

### Cancellation

[`os_workgroup_cancel`](/documentation/os/os_workgroup_cancel)

Cancels and invalidates the specified workgroup.

[`os_workgroup_testcancel`](/documentation/os/os_workgroup_testcancel)

Returns a Boolean value that indicates whether the workgroup is canceled.

### Workgroup Configuration

[`os_workgroup_max_parallel_threads`](/documentation/os/os_workgroup_max_parallel_threads)

Returns the maximum number of threads that the system recommends you add to the specified workgroup.

[`os_workgroup_mpt_attr_t`](/documentation/os/os_workgroup_mpt_attr_t)

An opaque structure containing attributes related to a request for the maximum number of parallel threads.

[`os_workgroup_set_working_arena`](/documentation/os/os_workgroup_set_working_arena)

Distributes a block of managed memory to the threads of a workgroup.

[`os_workgroup_get_working_arena`](/documentation/os/os_workgroup_get_working_arena)

Retrieves the workgroup’s shared data, and the thread-specific index into that data.

[`os_workgroup_index`](/documentation/os/os_workgroup_index)

A unique index that the workgroup assigns to its joined threads.

[`os_workgroup_working_arena_destructor_t`](/documentation/os/os_workgroup_working_arena_destructor_t)

A function that deallocates a workgroup’s currently assigned shared memory.

### Common Utilities

[`os_workgroup_create_with_workgroup`](/documentation/os/os_workgroup_create_with_workgroup)

Create a new workgroup that is bound to the specified workgroup.

[`os_workgroup_create_with_port`](/documentation/os/os_workgroup_create_with_port)

Creates a new workgroup that is bound to the workgroup with the specified Mach port.

[`os_workgroup_copy_port`](/documentation/os/os_workgroup_copy_port)

Returns the Mach port associated with the workgroup.

[`os_workgroup_t`](/documentation/os/os_workgroup_t)

An opaque object representing a default workgroup in the current process.

[`os_workgroup_attr_t`](/documentation/os/os_workgroup_attr_t)

An opaque structure for storing workgroup-related attributes.

### Objective-C Support

[`OS_os_workgroup_interval`](/documentation/os/OS_os_workgroup_interval-c.class)

[`OS_os_workgroup_interval`](/documentation/os/OS_os_workgroup_interval-c.protocol)

[`OS_os_workgroup`](/documentation/os/OS_os_workgroup)

[`OS_object`](/documentation/os/OS_object)

### Internal Structures

[`OS_os_workgroup_parallel`](/documentation/os/OS_os_workgroup_parallel-c.class)

[`OS_os_workgroup_parallel`](/documentation/os/OS_os_workgroup_parallel-c.protocol)



---

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)