2.7_Binder系统_transaction_stack机制_REPLY

总体流程:

A发送bc_transaction驱动程序会转换为BR_transaction。

问题1、发给谁?

问题2、回复给谁?

 

有两个问题

1、发给谁:

test_server中可能有多个线程,binder_proc进程中有todo链表, 进程的thread中也有多个链表。
数据一般放在bind_proc的todo链表中,线程中哪个空闲哪个来执行(唤醒等待于binder_proc,wait的空闲进程)。

proc中有todo链表与wait

对于双向传输,则放放在binder_thread.todo里,如何判断是否为双向传输通过 binder_transaction判断

一开始没有数据,那就放至proc的链表中。

再把数据放至target_list链表,该链表就是server的链表与wait链表。

2、回复给谁:

由于无handle表明目的进程,必定在某个地方有记录发送者。存放在此transaction_stack

发送出去还想得到回复,放至传输栈中。

这里from_parent在发送者的栈中

 t表示当前的传输,发给谁、来自于哪里。

test.client其中有一个transaction_stack结构体,用来表示传输栈用来指向一个传输结构 ,其中fram_parent为NULL。

从test_server的binder_proc中的todo链表中取出数据。

t为target将transaction_stack放到target中。

to_parent在接收者的栈中

testServer出栈

testClient出栈

binder_pop_transaction(target_thread, in_reply_to);
	target_thread->transaction_stack =
			target_thread->transaction_stack->from_parent;

回复给谁

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值