I am reading through the binder code and trying to understand how the
threading works. I know that the binder driver sends commands to
increase the thread pool size when it detects that there is no free
binder thread to service a command (up to the max of 16 threads). But
I am not sure when these newly spawned threads are removed.
In IPCThreadState.cpp:
void IPCThreadState::joinThreadPool(bool isMain) {
...
result = executeCommand(cmd);
...
if(result == TIMED_OUT && !isMain) {
break;
}
...
}
I see that the thread breaks out of the thread pool loop when result
is set to TIMED_OUT, which in turn happens when the binder drive sends
a command of BR_FINISHED. This would result in the handling binder
thread to leave the thread pool and essentially end. But I looked
through the binder driver source code and could not find any instance
in which the driver would deliver this command to binder thread. Does
this mean the binder thread pool will only grow in size and never
shrink?
I would appreciate any help on this topic.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en