且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

并单线程应用程序利用多核心的Andr​​oid?

更新时间:2023-11-22 19:51:10

答案是:

安卓基本上是在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.

说了这么多,请注意,芯片制造商,如高通正在开发能够智能处理器子划分您的单线程应用程序code(当且仅当有互相排斥的部分)为多个线程,并让它运行在不同的内核。这里再次,其基本原理仍然相同。 - 为了利用多芯,单个线程被细分成多个线程

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.