Threads -parallel process-

Post Reply
elnanni
Posts: 23
Joined: Sat Nov 14, 2009 1:41 am

Threads -parallel process-

Post by elnanni » Thu Jan 07, 2010 3:31 am

Ok, so I want to draw something in the touch screen, and it takes a while, but at the same time I want to draw something else in the other screen, so, I know I can do both drawings at the same time, but I don't want to mix drawings, so, is there a way to do parallel processing in the DS?? If not, I think I can try to do it by using pointers to functions :S, any idea :S??

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: Threads -parallel process-

Post by elhobbs » Thu Jan 07, 2010 4:25 am

Threads are not supported with libnds. You are probably better off breaking the large job into small chunks and do a little bit at a time. Though it is possible to map VRAM banks C and D to the arm7 processor it is probably not worth the effort.

StevenH
Posts: 133
Joined: Sun Feb 22, 2009 7:59 pm

Re: Threads -parallel process-

Post by StevenH » Thu Jan 07, 2010 12:44 pm

Actually there is a proof of concept code that WolfgangSt wrote that uses fibers to do parallel processing, but the work involved in taking it past the PoC stage is a little too much for most of the usefull things that you need fibers for (also the overhead on the stack, etc is sometimes a little too much for the DS's lack of MMU).

The best way, and the only way IMO, would be to mix the drawings and do a part of the drawings on each screen. I know that the official SDK has threads in them (This knowledge is from reading the libdual* source code BTW not any official docs) but talking to WinterMute at the time about it (even when the fiber test app was floating about) the limited DS stack and lack of support for hardware memory management means that a lot of the tools and features that you take for granted on a PC just does not exist on the DS.


* libdual was a rebranding of a leaked copy of an early version of the offical sdk that a few of us downloaded as it was advertised on the gbadev forums as the "Official Nintendo Homebrew SDK" and "libnds beater". It opened my eyes on how much thought had went into the official SDK, and how much work has went into libnds. The site has since been taken down after it being reported to Nintendo.

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

Re: Threads -parallel process-

Post by WinterMute » Fri Jan 08, 2010 12:53 am

It really depends on what exactly it is you want to do, what's being drawn on the touch screen and what do you want to draw on the other screen?

Neither fibers nor threads are parallel processing, they're both methods of task switching. The DS does have two processors but the arm7 doesn't have access to video hardware and limited memory which makes it difficult to do anything particularly useful in parallel.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest