> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.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](/services/playfab/multiplayer/networking/xblreference/enums/partyxblthreadid)

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()](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_geterrormessage).

## Remarks

This method enables the application to configure the processor affinity for internal Party XBOX Live Helper library thread of a given type. <br /><br /> This method may be called at any time before or after [Initialize()](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_initialize) and will take effect immediately. Thread processor settings are persisted across calls to [Cleanup()](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_cleanup) and Initialize(). When there are more than 64 cores present, this method always applies to processor group 0.   <br /><br /> 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](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/partyxblmanager)\
[PartyXblThreadId](/services/playfab/multiplayer/networking/xblreference/enums/partyxblthreadid)\
[PartyXblManager::GetThreadAffinityMask](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getthreadaffinitymask)


## Related topics

- [PartyXblManager::GetThreadAffinityMask](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_getthreadaffinitymask.md)
- [PartyXblManager::Initialize](/services/playfab/multiplayer/networking/xblreference/classes/PartyXblManager/methods/partyxblmanager_initialize.md)
- [PartyXblThreadId](/services/playfab/multiplayer/networking/xblreference/enums/partyxblthreadid.md)
- [PartyManager::SetThreadAffinityMask](/services/playfab/multiplayer/networking/reference/classes/PartyManager/methods/partymanager_setthreadaffinitymask.md)
- [chat_manager::set_thread_affinity_mask](/reference/chat/gamechat2/classes/chat_manager/methods/chat_manager_set_thread_affinity_mask.md)
