Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does single thread application utilize multi core in android?

Does single thread application use all the 4 core in a Quad-core phone. I searched this a lot and found some articles that says yes and some saying no. some articles even say the android OS doesn't utilize the 4 core.

Is android capable of using all 4 cores in an Quad core processor?

Does single thread application utilize multi core?

like image 633
null pointer Avatar asked May 15 '13 10:05

null pointer


People also ask

Can a single thread process run on multiple cores?

In short: yes, a thread can run on different cores.

Is Android single threaded or multithreaded?

When an application component starts and the application does not have any other components running, the Android system starts a new Linux process for the application with a single thread of execution. By default, all components of the same application run in the same process and thread (called the "main" thread).

Does single thread mean single core?

Single threaded does not mean single-core, single process, or one-thing-at-a-time. by Eric Elliott | Medium. Instead of worrying so much about how fast JavaScript code executes (which for most applications is… Single threaded does not mean single-core, single process, or one-thing-at-a-time.


1 Answers

The answer is YES.

Android is basically built upon Linux kernel which does utilize mulit-core. As far as single-threaded-application is concerned, remember that a thread can not be executed in-parts on different cores simultaneously. So although your single-thread can be executed by different cores at different point in times, it can not be sub-divided and executed by different cores at the same time.

Having said that, please be aware that chipset manufacturers like Qualcomm are developing intelligent processors capable of sub-dividing your single-threaded app code (if and only if there are mutually exclusive parts) into multiple threads and have it run on different cores. Here again, the basic principle remains same - in order to utilize multi-core, the single thread was sub-divided into multiple threads.

To get the most out of your multi-core chip, you would rather create a multi-threaded app, with maximum possible asynchronous threads, so as to have optimum utilization of maximum number of cores. Hope this clears.

EDIT:

This also translates to - An app that does not make use of multiple asynchronous threads (or any other parallelism construct) will NOT use more than one core.

like image 192
Gagan Avatar answered Sep 27 '22 19:09

Gagan