2-3 threads are usually created for the binder IPC thread pool. On Fri, May 7, 2010 at 4:11 AM, Hristo Bojinov <[email protected]>wrote:
> The Calculator is a Dalvik /"Java"/ app. All those get forked off of > zygote for performance reasons (zygote is an empty VM instance, ready > to spawn/fork off real apps; it has many libraries preloaded in its > address space, etc.). > > http://developer.android.com/reference/dalvik/system/Zygote.html > > Not sure why multiple threads though. > > --Hristo > > > > On May 6, 12:15 pm, Vesmar <[email protected]> wrote: > > Hi all, > > > > Im studing how Android creates new processes and found two scenarios. > > > > when I am running native programs on a terminal on Android (ps, ls, > > mkdir, etc) all programs are created in the standard way, that is, > > fork (clone) and execve system calls. The process name on task struct > > is set by the putname() on the sys_execve syscall handler. > > > > But when I run a Android application such the Calculator, for example, > > i found 6 new tasks (processes or threads) forked by zygote. In fact, > > zygote forks just one process and this new process spawns 4 new > > processes and set their names using set_task_comm() and the last one > > forks an aditional process. And at the last set_task_comm() is called > > for the first forked process from zygote. > > > > So there are two ways for set the task->comm field for a process: The > > standard way (using execve and putname()) and a new way used by > > Android using sys_prctl who calls set_task_comm(). > > > > Does anyone have more information on how processes are created on > > Android and why a App needs all theis tasks forked by zygote? Why > > execve is not used and what is used instead? > > > > I m using Android for Mips using the Arriba QEMU emulator as my > > experimentation platform. > > > > Thanks, > > > > -- > > unsubscribe: > > [email protected]<android-kernel%[email protected]> > > website:http://groups.google.com/group/android-kernel > > -- > unsubscribe: > [email protected]<android-kernel%[email protected]> > website: http://groups.google.com/group/android-kernel > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel
