Binder 介绍
来源:互联网 发布:js btoa函数 编辑:程序博客网 时间:2024/05/17 03:01
http://blog.csdn.net/luoshengyang/article/details/6618363
Binder是一种进程间通信机制,是android中IPC(进程间通信)的具体实现。Linux中本身就有支持IPC(进程间通信)的工具,如:管道(Pipe)、信号(Signal)、消息队列(Mesage Queue)(包括Posix消息队列、system V消息队列)、共享内存、信号量(semphore)、套接口(Socket )。但是Android中的Binder除了实现进程间通信,还可以调用另一个进程的函数或方法,更加强大。它是一种类似于COM和CORBA分布式组件架构,通俗一点,其实是提供远程过程调用(RPC)功能。从英文字面上意思看,Binder具有粘结剂的意思,那么它把什么东西粘结在一起呢?在Android系统的Binder机制中,由一系统组件组成,分别是Client、Server、Service Manager和Binder驱动程序,其中Client、Server和Service Manager运行在用户空间,Binder驱动程序运行内核空间。Binder就是一种把这四个组件粘合在一起的粘结剂了,其中,核心组件便是Binder驱动程序了,Service Manager提供了辅助管理的功能,Client和Server正是在Binder驱动和Service Manager提供的基础设施上,进行Client-Server之间的通信。Service Manager和Binder驱动已经在Android平台中实现好,开发者只要按照规范实现自己的Client和Server组件就可以了。
服务注册: Server先与Context Manageer通过Binder将服务注册到ContextManagr中
服务搜索: Client 再与Context Manager 通过Binder在Context Manager中 搜索需要的服务。
服务使用: Client与Server通过Binder通信,而使用服务。
总结一下,Android系统Binder机制中的四个组件Client、Server、Service Manager和Binder驱动程序的关系如下图所示:
1. Client、Server和Service Manager实现在用户空间中,Binder驱动程序实现在内核空间中
2. Binder驱动程序和Service Manager在Android平台中已经实现,开发者只需要在用户空间实现自己的Client和Server
3. Binder驱动程序提供设备文件/dev/binder与用户空间交互,Client、Server和Service Manager通过open和ioctl文件操作函数与Binder驱动程序进行通信
4. Client和Server之间的进程间通信通过Binder驱动程序间接实现
5. Service Manager是一个守护进程,用来管理Server,并向Client提供查询Server接口的能力
- Binder 介绍
- Binder介绍
- Binder介绍
- Binder机制---Binder原理介绍
- Binder进程通信介绍
- Binder常用方法介绍
- Android Binder机制介绍
- Android Binder 入门介绍
- Android Binder机制介绍
- Binder机制1---Binder原理介绍
- android Binder机制1---Binder原理介绍
- Binder机制1---Binder原理介绍
- Binder机制1---Binder原理介绍
- Binder机制1---Binder原理介绍
- Binder机制1---Binder原理介绍
- Binder机制1---Binder原理介绍
- Binder机制1---Binder原理介绍
- Android Binder 三句话介绍
- TCP
- 手机游戏最新技术选型之Flash AIR
- new (nothrow) T() 的原理
- 把GridView导入Excel,把GridView打印出来!
- NYOJ451 光棍节的快乐
- Binder 介绍
- WordPress博客里面放谷歌广告代码
- 微软安全新闻聚焦-双周刊第二十期
- 管理日志:甚是无奈
- 2012-09-27华为机试
- 【Homework】【整理】SSS 2012-09-25
- Bash的输入输出重定向
- fluent访问多个日志目录的配置方法
- android 开发环境的搭建