<!--
{
  "availability" : [
    "DriverKit: -",
    "iOS: -",
    "iPadOS: -",
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "DriverKit",
  "identifier" : "/documentation/DriverKit/IOWorkGroup",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "DriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOWorkGroup"
  },
  "title" : "IOWorkGroup"
}
-->

# IOWorkGroup

```
class IOWorkGroup;
```

## Overview

\abstract Workgroups allow multiple threads to coordinate activities for realtime operations.
\discussion 

Applications that open user clients to a DriverKit driver can send a workgroup to use in the driver.

The application will have to first create an workgroup object. The application then should copy the
workgroup port with os_workgroup_copy_port(). To send the workgroup port to the driver, use:

const char * name = “Work Group Name”; // This must match the name the driver used in IOWorkGroup::Create().
kern_return_t ret = IOConnectTrap3(connect, // user client connection (io_connect_t)
1, // specifies event link configuration trap
(uintptr_t)name,
(uintptr_t)strlen(name),
(uintptr_t)wgPort // port from os_workgroup_copy_port
);

Once the workgroup port has been sent to the driver, the driver should be notified with a user-defined external method
or other existing signaling mechanism.

## Topics

### Instance Methods

[`size_t GetTokenSize();`](/documentation/DriverKit/IOWorkGroup/GetTokenSize)

[`kern_return_t Invalidate();`](/documentation/DriverKit/IOWorkGroup/Invalidate)

[`kern_return_t Join(void *token);`](/documentation/DriverKit/IOWorkGroup/Join)

[`kern_return_t Leave(void *token);`](/documentation/DriverKit/IOWorkGroup/Leave)

[`virtual void free();`](/documentation/DriverKit/IOWorkGroup/free)

[`virtual bool init();`](/documentation/DriverKit/IOWorkGroup/init)

### Type Methods

[`static kern_return_t Create(OSString *name, IOUserClient *userClient, IOWorkGroup **workgroup);`](/documentation/DriverKit/IOWorkGroup/Create)

## Relationships

### Inherits From

[`OSObject`](/documentation/DriverKit/OSObject)

---

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)