diff options
author | We-unite <3205135446@qq.com> | 2024-07-19 13:35:36 +0800 |
---|---|---|
committer | We-unite <3205135446@qq.com> | 2024-07-19 16:34:07 +0800 |
commit | 2e37dcf708be08dff963ee08cb7a9557f32e690d (patch) | |
tree | e06ce0d1284a8d4ba67c780ad3f92c4e51d93774 /src/godo.go | |
parent | 58b1af7139bd2c4a2682382261fcc545b86d8685 (diff) | |
download | godo-2e37dcf708be08dff963ee08cb7a9557f32e690d.tar.gz godo-2e37dcf708be08dff963ee08cb7a9557f32e690d.zip |
Fix some bugs, and 3nd coroutine can get pid tree.base
For some reasons, the linux kernel has made some changes in syscalls.
As shown in src code, we pay attention to fork/vfork/clone to create
process, while exit/exit_group to kill it. From my opinion, the fork
and clone syscall should be totally different, otherwise there will
be only one syscall. However, according to the logs, I heard only
clone but no fork, exit_group but no exit. Infact, fork calls clone
and then makes some special set. They're different, fork means parents
and children, while clone means calling and callee, which allows to
share sth between caller and callee. Both fork and clone makes a new
process, pthread makes tasks and is called thread. Pid is factually
task id.
Now the 3 coroutines works well, and I've get a process tree by
map[int]*process. Here hides some questions:
- is it right for 2nd corutine to send to 3rd as long as eoe?
- how to make the delay between exit_group and deletePid clear and
suitable?
Next works:
- Change the pids from map into DataBase, which means that we
should devide front-end and back-end. Besides, when you delete
sth(such as process exit), don't delete from databese, instead
just make a tag and record their exit code. In other words, we
judge if it's alive not by entry existance but exit tag.
- Make containers recorded, for instance, rootFS, root-process,
name, id, etc.. And record them in map, maintain this database table.
Diffstat (limited to 'src/godo.go')
0 files changed, 0 insertions, 0 deletions