widows下的进程与服务

进程:

当程序卡死的时候,我们可以直接通过任务管理器来关闭进程。

服务:

在这个界面,我们可以选择启动或者关闭相关服务,还可以选择服务是否自动启动。

以关闭MySQL自启动服务为例:https://jingyan.baidu.com/article/b87fe19e6e468f52183568e2.html

我们都知道进程就是正在运行的程序,很多人就会问服务是什么?

在windows下进程与服务在本质上没有区别,唯一的区别就在于进程一般由用户来控制,而服务则是由系统控制的。

大家可以参考这段解释,这段解释来自于stack overflow:

A service is a true-blooded Windows process, no difference there. The only thing that's special about a service is that it is started by the operating system and runs in a separate session. An isolated one that keeps it from interfering with the desktop session. Traditionally named a daemon.

大致翻译如下:

一个服务完完全全就是一个Windows进程,两者并没有什么区别。对于服务而言,唯一比较特殊的就是它由操作系统来启动并且运行在一段独立的会话中。一个孤立的且不与前端会话进行交互的服务一般被称为守护进程
原文地址:https://www.cnblogs.com/mlgjb/p/8777181.html