Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Proposed changes to threading API

Re: Proposed changes to threading API

From: Greg Haerr <greg_at_censoft.com>
Date: Mon, 7 Aug 2006 17:14:12 -0600

: With regards to creating a thread on the second core, there is no
: guarantee that this will be available even on PortalPlayer machines, so
: the code to create a thread on the second core would be something like:
:
: my_thread = create_thread_on_core(COPROCESSOR, my_function, my_stack,
: sizeof(my_stack), my_thread_name);
: if(my_thread == -1)
: my_thread = create_thread_on_core(CPU, my_function, my_stack,
: sizeof(my_stack), my_thread_name);

Looks like lots of duplicated code. Why not have all this handled
in the create_thread_on_core function, and/or in the threading
library only. Then you'll always get a thread when asking for one
and not have to write code to handle a failure case every time.

The main vs coprocessor request could be handled with a flag
argument to the standard create_thread routine. Also, why
a special remove_thread_on_core routine?

Perhaps I need a quick tutorial on the kinds of things that need/want
to be handled on multiple cores.

Regards,

Greg
Received on 2006-08-08


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa