RenderScript does this using threads. Linux is quite good at scheduling threads on different cores.
On Fri, Mar 4, 2011 at 1:58 PM, webmonkey <[email protected]> wrote: > Thanks fadden, don't know how I missed this obvious API. > > When Honeycomb is open-sourced will we be able to see (and copy) how > RenderScript schedules these tasks, or is that handled to deep in the > system. > > On Mar 4, 9:08 pm, fadden <[email protected]> wrote: > > On Mar 3, 1:29 pm, webmonkey <[email protected]> wrote: > > > > > Let's say you have a task that is suitable for parallel processing. > > > Can you detect the number of cores in Android and then make sure that > > > the threads you create run on each separate core. > > > > If you have parallelizable tasks, just put them in separate threads. > > The Linux thread scheduler will take care of the rest. Bear in mind > > that there may be other actions going on in the system, so it's > > possible that not all cores will be available for your app's use. > > > > Runtime.getRuntime().availableProcessors() will tell you the maximum > > number of available cores. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

