Pages: 1
Posted on 07-28-15, 08:05 pm
Paragoomba


Karma: 37
Posts: 62/69
Since: 01-29-14
This might be kind of a stupid question, and I am almost positive that the answer will be no, but is it possible to use the standard multithreading library (from C++11 and runs on POSIX threads) and atomic operations library in my hacks?
_________________________
Posted on 07-30-15, 03:18 pm (rev. 2 by  Dirbaio on 07-30-15, 03:43 pm)
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 10010
Posts: 4286/4457
Since: 06-08-11
Yep, the answer is sadly no
I haven't actually tried it but I'm pretty sure it won't work.

Nintendo's devkit does have their own threading stuff. Here you have an example on how to create a thread:
https://github.com/Dirbaio/NSMBCR/blob/master/source/soundThread.cpp#L28-29

void OS_CreateThread(OSThread* thread, void (*func)(void*), void* arg, void* stack, u32 stackSize, u32 prio);


I'm not exactly sure if the thread can be preempted anytime or only when it explicitly waits for vblank or something else...
Also the NDS has only one core so there's no real "concurrency", atomic stuff is not really that useful. You won't gain any performance benefits either, the only advantage to threads I can think of is being able to manage priorities. For example, on the sound hack, the sound decoding thread is lowest priority, so it decodes music as fast as possible without slowing down the game.
Posted on 07-30-15, 03:30 pm
☭ coffee and cream


Karma: 10415
Posts: 1765/2768
Since: 06-26-11
Considering how both 3DS and WiiU get cooperative threading, this is probably cooperative too.
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Posted on 07-31-15, 02:06 am
Paragoomba


Karma: 37
Posts: 64/69
Since: 01-29-14
Thank you.
_________________________
Pages: 1