Page 1 of 1

How to use svcSetThreadCoreMask

Posted: Tue Mar 05, 2019 9:30 pm
by devMiyax
HI,

I am new to devkitPro and Switch Development and I am developing Homebrew app using libnx.
What I'm suffering is multi-threading. In my app a thread seems to block other threads. I think it is due that my process uses only one CPU core. I find the function svcSetThreadCoreMask. I guess this function can control which thread uses which CPU core.

How can I use this function and make threads run parallelly?

Re: How to use svcSetThreadCoreMask

Posted: Wed Mar 06, 2019 6:24 pm
by WinterMute
Don't try to use svc functions at all. The easiest thing for you is probably C11 threads right now, see https://en.cppreference.com/w/c/thread

Re: How to use svcSetThreadCoreMask

Posted: Wed Mar 06, 2019 6:27 pm
by fincs
As a bonus, C11 threads as implemented by libnx are preemptively multithreaded & load balanced across cores.