gpt4 book ai didi

android - 每个Android进程都有自己的线程吗?

转载 作者:行者123 更新时间:2023-11-29 16:38:05 25 4
gpt4 key购买 nike

根据定义,每个 Android 进程是否都启动自己的线程?特别是,如果我通过在我的 list 文件中设置其 android:process 属性,在同一应用程序的单独进程中启动服务,它会自动在单独的线程上运行吗来 self 的应用默认进程的主线程?

我已经通读了 Processes and Threads Android 文档,这似乎是暗示,但它没有直接回答问题。

最佳答案

是的,既然是不同的进程,那就是不同的线程。

android:process

The name of the process where the service is to run.Normally, all components of an application run in the default processcreated for the application. It has the same name as the applicationpackage. The element's process attribute can set adifferent default for all components. But component can override thedefault with its own process attribute, allowing you to spread yourapplication across multiple processes.

https://developer.android.com/guide/topics/manifest/service-element

进程内运行的线程

https://www.slashroot.in/difference-between-process-and-thread-linux

关于android - 每个Android进程都有自己的线程吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52062181/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com