单线程应用程序是否在 android 中使用多核? [英] Does single thread application utilize multi core in android?

查看:29
本文介绍了单线程应用程序是否在 android 中使用多核?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

单线程应用程序是否使用四核手机中的所有 4 核.我搜索了很多,发现一些文章说是,有些说不是.有些文章甚至说 android 操作系统不使用 4 核.

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.

Android 是否能够在四核处理器中使用所有 4 个内核?

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

单线程应用程序是否使用多核?

Does single thread application utilize multi core?

推荐答案

答案是YES.

Android 基本上是基于 Linux 内核构建的,该内核确实利用了多核.就单线程应用程序而言,请记住一个线程不能同时在不同的内核上部分执行.所以你的单线程虽然可以在不同的时间点被不同的核心执行,但不能同时被不同的核心细分执行.

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.

这也意味着 - 不使用多个异步线程(或任何其他并行结构)的应用不会使用多个内核.

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.

这篇关于单线程应用程序是否在 android 中使用多核?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆