安卓:什么是捆扎线?

2023-09-06 13:24:05 作者:远在北方孤独的鬼

我用Debug.startMethodTracing我的目的,并在输出文件中,我可以看到(我不使用IPC):

I use Debug.startMethodTracing for my purposes and in the output file I can see(I don't use IPC):

8   Binder Thread #2
7   Binder Thread #1

有关它是什么?

推荐答案

捆扎线重新presents服务的一个单独的线程。粘合剂是,它提供进程间通信机制。

Binder thread represents a separate thread of your service. Binder is a mechanism that provides Inter Process Communication.

让我们来看一个例子。试想一下,你的服务流程B(见图)。而你有一个与该服务B(这个应用程序是一个,例如,进程A)交流几个应用程序。因此,一个服务B应该同时向不同的应用提供不同的结果。因此,你需要为不同的应用程序中运行的服务B多个副本。 Android的运行在进程B的不同的线程,这些线程这些副本被称为粘合剂线程#N。

Let's consider an example. Imagine that you have service Process B (see picture). And you have several applications that communicate with this service B (one of this application is, for instance, Process A). Thus, one service B should provide different results simultaneously to different applications. Thus, you need to run several replicas of Service B for different applications. Android runs these replicas in different threads of the Process B and these threads are called "Binder Thread #N".

我拍的照片here,在这里你还可以读到粘合剂。

I took the picture here, where you can also read what Binder is.

相关推荐