> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PartyXblManager::SetThreadAffinityMask

> Optionally configures the processor on which internal Party XBOX Live Helper library threads will run.

Optionally configures the processor on which internal Party XBOX Live Helper library threads will run.

## Syntax

```cpp theme={null}
PartyError SetThreadAffinityMask(  
    PartyXblThreadId threadId,  
    uint64_t threadAffinityMask  
)  
```

### Parameters

**`threadId`**   [PartyXblThreadId](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/enums/partyxblthreadid.md)

The type of internal library thread for which processor affinity should be retrieved.

**`threadAffinityMask`**   uint64\_t

The affinity mask for this type of Party thread.

### Return value

PartyError

`c_partyErrorSuccess` if the call succeeded or an error code otherwise. The human-readable form of the error code can be retrieved via [GetErrorMessage()](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_geterrormessage.md).

## Remarks

This method enables the application to configure the processor affinity for internal Party XBOX Live Helper library thread of a given type. \
\
&#x20;This method may be called at any time before or after [Initialize()](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_initialize.md) and will take effect immediately. Thread processor settings are persisted across calls to [Cleanup()](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_cleanup.md) and Initialize(). When there are more than 64 cores present, this method always applies to processor group 0.   \
\
&#x20;In order to specify any processor, pass `c_anyProcessor` as the `threadAffinityMask` parameter. This is also the default value the Party XBOX Live Helper library will use if this method is never called.

## Requirements

**Header:** PartyXboxLive.h

## See also

[PartyXblManager](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/partyxblmanager.md)\
[PartyXblThreadId](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/enums/partyxblthreadid.md)\
[PartyXblManager::GetThreadAffinityMask](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getthreadaffinitymask.md)


## Related topics

- [PartyXblManager::GetThreadAffinityMask](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getthreadaffinitymask.md)
- [PartyXblManager::Initialize](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_initialize.md)
- [PartyXblThreadId](https://docs.xbox.com/services/playfab/multiplayer/networking/xblreference/enums/partyxblthreadid.md)
- [PartyManager::SetThreadAffinityMask](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_setthreadaffinitymask.md)
- [PartyManager::GetThreadAffinityMask](https://docs.xbox.com/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_getthreadaffinitymask.md)
