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 <ves...@gmail.com> 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: android-kernel+unsubscr...@googlegroups.com
> website:http://groups.google.com/group/android-kernel

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to