2cd/zsh

about multiple process of zsh

cyantau opened this issue · 1 comments

After using mtoe to install zsh, there seems to appear many process when type ps to check.

$ps

  PID TTY          TIME CMD
 4397 pts/0    00:00:00 ps
30375 pts/0    00:00:07 zsh
31460 pts/0    00:00:00 zsh
31461 pts/0    00:00:00 zsh
31464 pts/0    00:00:00 zsh
31536 pts/0    00:00:00 gitstatusd-linu

So why could be like this and is there any approach to avoid?

2moe commented

This may be caused by the theme.
First, run zshtheme to change your theme, then restart the zshell or terminal, finally run ps -ef | grep zsh


So, why are there so many processes? Is this situation bad?

This will be analysed on a case-by-case basis.
In some cases, they are just useless zombie processes.
In other cases, it may be the product of "asynchronous".


So, what is asynchronous? And, what is the difference between concurrency and parallelism?

In fact, we don't need to know that much.
All we need to know is that sometimes asynchronous can "look" faster than synchronous.

When we queue, we can listen to music on our bluetooth headphones instead of standing around silently.
Sometimes doing two things at once can make everything worse.
Other times, that's not so bad.


Run htop and type /zsh to check the status of zsh.
Are these processes using a lot of memory and CPU resources?
If not, then I don't think there's any need to care about it.