How to use svcSetThreadCoreMask

Post Reply
devMiyax
Posts: 1
Joined: Tue Mar 05, 2019 9:11 pm

How to use svcSetThreadCoreMask

Post by devMiyax » Tue Mar 05, 2019 9:30 pm

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?

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: How to use svcSetThreadCoreMask

Post by WinterMute » Wed Mar 06, 2019 6:24 pm

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
Help keep devkitPro toolchains free, Donate today

Personal Blog

User avatar
fincs
( ͡° ͜ʖ ͡°)
Posts: 93
Joined: Mon Jul 12, 2010 9:45 pm
Location: Seville, Spain
Contact:

Re: How to use svcSetThreadCoreMask

Post by fincs » Wed Mar 06, 2019 6:27 pm

As a bonus, C11 threads as implemented by libnx are preemptively multithreaded & load balanced across cores.
Donate to devkitPro - help us stay alive!

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests