<!--
{
  "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_get_working_arena",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "os"
    ],
    "preciseIdentifier" : "c:@F@os_workgroup_get_working_arena"
  },
  "title" : "os_workgroup_get_working_arena"
}
-->

# os_workgroup_get_working_arena

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

```
extern void *os_workgroup_get_working_arena(os_workgroup_t wg, os_workgroup_index *index_out);
```

## Parameters

`wg`

The workgroup that contains the context data. If the current thread isn’t a member of this workgroup, this function crashes the app.

`index_out`

A pointer to an index variable. On output, this parameter contains the index of the thread in the specified workgroup. Specify `NULL` if you don’t want the function to assign a unique index to this thread.

## Return Value

A pointer to the workgroup’s shared data, or `NULL` if the workgroup has no shared data.

## Discussion

Use this function to retrieve the workgroup’s shared data. The first time you call this function on a thread and request an index, the workgroup assigns an index to the thread and returns it. On subsequent calls from the same thread, the workgroup returns the same index value.

When you call the [`os_workgroup_set_working_arena`](/documentation/os/os_workgroup_set_working_arena) function, you specify the maximum number of unique threads that may request an index from the workgroup. If you exceed that maximum, this function crashes your app.

---

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)