Multi-threading

Revision as of 16:49, 25 May 2015 by Lectem (talk | contribs) (Created page with "This page is a work in progress. Put everything related to multi-threading here, threads, synchronization, multi-core support, etc. The Nintendo 3DS offers support for threading...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This page is a work in progress. Put everything related to multi-threading here, threads, synchronization, multi-core support, etc.

The Nintendo 3DS offers support for threading through use of SVC calls.

Threads

For Kernel implementation details, see KThread.

Though it is possible to run multi-threaded programs, running those on different cores is not possible "as-is". One core is always dedicated to the OS, hence you will never get 100% of both cores.

Usage

CreateThread

ExitThread

SleepThread

GetThreadPriority

SetThreadPriority

OpenThread

GetProcessIdOfThread

GetThreadId

GetThreadInfo

GetThreadContext

Core affinity

GetThreadAffinityMask

SetThreadAffinityMask

GetThreadIdealProcessor

SetThreadIdealProcessor

Debug

GetThreadList

GetDebugThreadContext

SetDebugThreadContext

GetDebugThreadParam

Synchronization

Most synchronization systems seem to have both a "normal" and "light-weight" version

Mutex (normal)

CreateMutex

/!\ It seems that the mutex will not be available once the thread that created it is destroyed

ReleaseMutex

Ciritical Section (light-weight mutex)

CriticalSection::Initialize

Same thread ownership as a mutex ?

CriticalSection::Enter

CriticalSection::Leave

Semaphore

Light Semaphore ?

Does it exist ?

Event

Light Event