# FMOD\_PSVita\_SetThreadAffinity bug report

**URL:** <https://qa.fmod.com/t/fmod-psvita-setthreadaffinity-bug-report/12758>\
**Category:** FMOD Studio\
**Created:** [October 19, 2016, 4:50am UTC](https://qa.fmod.com/t/fmod-psvita-setthreadaffinity-bug-report/12758 "2016-10-19T04:50:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dismiss](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/dismiss/32/1137_2.png) [@Dismiss](https://qa.fmod.com/u/Dismiss)\
**Post date:** [October 19, 2016, 4:50am UTC](https://qa.fmod.com/t/fmod-psvita-setthreadaffinity-bug-report/12758/1 "2016-10-19T04:50:44Z")

</div>

The fmod api for specifying thread affinity is unnecessarily constraining me to only specify a single core.

Note that there is no such restriction on the affinity mask for psv threads in general. The main thread, and all other threads I allocate end up with a mask of 111 so they can be run on any core.

Also note that the ps4 version of this same enum represents bit flags rather than the ‘core index’.

I would propose that this enum should be changed:

```
// jcf: bad version
/*
typedef enum
{
	FMOD_THREAD_DEFAULT,
	FMOD_THREAD_CORE0,
	FMOD_THREAD_CORE1,
	FMOD_THREAD_CORE2,
	FMOD_THREAD_MAX
} FMOD_THREAD;
*/

// jcf: good version
typedef enum
{
	FMOD_THREAD_DEFAULT = 0,
	FMOD_THREAD_CORE0 = (1<<0),
	FMOD_THREAD_CORE1 = (1<<1),
	FMOD_THREAD_CORE2 = (1<<2),
	FMOD_THREAD_ANYCORE = (1<<0)|(1<<1)|(1<<2),
	FMOD_THREAD_MAX
} FMOD_THREAD;

// jcf: even better, less redundant version
typedef enum
{
	FMOD_THREAD_CORE0 = (1<<0),
	FMOD_THREAD_CORE1 = (1<<1),
	FMOD_THREAD_CORE2 = (1<<2)
} FMOD_THREAD;
```

---

<div class="post-metadata">

**Author:** ![mathew](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/mathew/32/431_2.png) [@mathew](https://qa.fmod.com/u/mathew)\
**Post date:** [October 25, 2016, 3:57am UTC](https://qa.fmod.com/t/fmod-psvita-setthreadaffinity-bug-report/12758/2 "2016-10-25T03:57:27Z")

</div>

Thanks for the request, I’ll schedule getting the PSVita affinity changed to a mask to match the PS4 one.
