安卓:什么是捆扎线? [英] Android: What is Binder Thread?

查看:112
本文介绍了安卓:什么是捆扎线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用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".

我拍的照片<一href="http://sujaiantony.word$p$pss.com/2011/12/28/an-android-101-an-overview-on-binder-framework/">here,在这里你还可以读到粘合剂。

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

这篇关于安卓:什么是捆扎线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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