当windows计算机关闭时,实际发生了什么?

虽然我们大多数人可能很少考虑每次关闭电脑时发生的所有事情,但在关闭过程中到底发生了什么?今天的超级用户问答帖子回答了一位好奇的读者的问题。...

当windows计算机关闭时,实际发生了什么?

虽然我们大多数人可能很少考虑每次关闭电脑时发生的所有事情,但在关闭过程中到底发生了什么?今天的超级用户问答帖子回答了一位好奇的读者的问题。

今天的问答环节是由SuperUser提供的,SuperUser是Stack Exchange的一个分支,是一个由社区驱动的问答网站分组。

问题

超级用户阅读器RACING121想知道Windows计算机关闭时实际发生的情况:

When I click the shutdown button on my Windows system, it gives me another screen saying Shutting down:

007Ys3FFgy1gpe2l0q34sj30hd06h0sl

What is actually going on during this stage?

If I recall correctly, in Windows XP it would say something like Saving Settings before powering off. However, what settings are there to actually save here? For example,  if you have applied a theme or completed some other action, it has already been “saved” when you clicked Apply or Ok.

If it is unmounting the hard drive, then surely it would be the same as forcing a shutdown by pulling the plug, right?

当一台Windows计算机经历关机过程时,实际发生了什么?

答案

超级用户贡献者Keltari和zzarzzur为我们提供了答案。首先,凯尔塔里:

There are a lot of things happening during the shutdown process. Here are just a few examples:

  • Checking to see if any user applicati*** have not been closed yet (like an unsaved document) and prompt the user if necessary
  • Stopping background services
  • Waiting for the termination signal from services and applicati*** that are open or running
  • Flushing the cache to disk
  • Writing log files
  • All users are logged out
  • Ending the shell
  • Start installing Windows updates and tell the system to finish the update process during the next system start-up if necessary
  • Send the ACPI shutdown signal (this is what turns the machine off)

然后是扎尔祖尔的回答:

The system registry is (maybe?) written to the disk. Back when I used Windows XP, I noticed that if you made any changes to the registry then pulled the power, the changes would not be saved. I am not quite sure about this one, just pointing it out.

Here is an excerpt from a document that Microsoft released:

  • System session shutdown. This phase includes the pre-shutdown notification and shutdown notification sub-phases.
  • Pre-shutdown notification. Windows serially shuts down all services that registered to receive pre-shutdown notificati***. Ordered services—services that have set up the shutdown order of dependent services—are shut down before non-ordered services.
  • Shutdown notification. All services that registered to receive shutdown notificati*** are shut down in parallel. If all services have not exited after 20 seconds (in Windows Vista) or 12 seconds (in Windows 7 client operating systems), the system continues the shutdown. Processes and services that do not shut down in a timely manner are left running as the system shuts down.
  • Kernel shutdown. The remainder of the system, such as all devices and drivers, are shut down during the kernel shutdown phase.

Basically, what you are waiting on is each individual service to clean up and exit. Each service is given 12 seconds to exit before it is killed.

Half of the shutdown time is dedicated to shutting down system services. If you are really interesting in seeing what time is dedicated to whatever during a shutdown, Windows includes a tool for tracing shutdown time.

  • xbootmgr -trace shutdown -numRuns 3 -resultPath %systemdrive%\traces -postBootDelay 180 -traceFlags base

And to make sense of the generated file (be sure to run in %systemdrive%\traces)

  • xperf -i trace.etl -o summary.xml -a shutdown

Sources

Windows On/Off Transition Performance Analysis Document [Microsoft]

Windows On/Off Transiti*** Soluti*** Guide Document [Microsoft]


有什么要补充的解释吗?在评论中发出声音。想从其他精通技术的Stack Exchange用户那里了解更多答案吗?在这里查看完整的讨论主题。

  • 发表于 2021-04-10 02:48
  • 阅读 ( 134 )
  • 分类:互联网

你可能感兴趣的文章

如何在windows10上设置局域网唤醒

... 局域网唤醒是一种网络标准。部署时,它允许远程打开计算机。它有一个补充标准,称为无线局域网唤醒(WoWLAN)。 ...

  • 发布于 2021-03-11 17:00
  • 阅读 ( 518 )

7个windows任务管理器进程,您永远不应该终止

...分位于Windows 10任务管理器列表的底部,其中包含一些对计算机正常运行至关重要的进程。 ...

  • 发布于 2021-03-13 00:03
  • 阅读 ( 309 )

windows虚拟机故障排除

...崩溃。 您可以使用安全模式从无法启动的计算机恢复文件。 ...

  • 发布于 2021-03-14 08:17
  • 阅读 ( 267 )

电源循环之谜:硬重启危险吗?

... 软重新启动(也称为热重新启动)是指当您的计算机关闭,重置自己,并再次启动而从不失去电源。当您打开“开始”菜单并单击“重新启动”时,您正在启动软重新启动:Windows关闭所有正在运行的应用程序和进程...

  • 发布于 2021-03-14 15:31
  • 阅读 ( 177 )

还有10个windows 10功能可以关闭

...全警报,防止广告在您的系统中弹出,还是仅仅提高您的计算机速度,我们都会为您提供服务。继续阅读了解更多。 ...

  • 发布于 2021-03-14 17:52
  • 阅读 ( 217 )

有史以来最可笑的12个错误

计算机和人类是如此的不同。虽然计算机处理信息的速度是无限快的,但如果它们试图偏离自己的方向,就会遇到麻烦。这些“快速**”与人们形成了鲜明的对比,他们的思维速度不如机器,但更容易适应。 ...

  • 发布于 2021-03-16 17:56
  • 阅读 ( 193 )

为什么windows会崩溃?故障排除指南

... 本文将重点讨论什么是意外的计算机崩溃以及如何识别问题。计算机崩溃的发生有多种原因。对于普通的PC用户来说,PC崩溃通常被视为PC损坏或损坏的迹象。在现实中,PC机的关闭很少值得担心。只要...

  • 发布于 2021-03-17 13:14
  • 阅读 ( 329 )

windows10死机黑屏的修复

...烁。安装程序可能仍在运行,但速度很慢,这可能是由于计算机的老化。在大多数情况下,Windows10应该在几个小时内安装完毕。 安装程序卡住:如果发生这种情况,并且没有硬盘驱动器活动,请按住电源按钮5秒钟...

  • 发布于 2021-03-17 23:44
  • 阅读 ( 336 )

当你打开电脑的时候到底发生了什么?

...PC、Mac还是Linux系统。 硬件开机 当您按下电源按钮时,计算机会为其组件提供电源—主板、CPU、硬盘、固态驱动器、图形处理器以及计算机中的所有其他组件。 提供电源的硬件被称为“电源”。在一台典型的台式电脑内,它...

  • 发布于 2021-04-04 02:37
  • 阅读 ( 311 )

当你关闭或注销windows时,到底会发生什么?

...天。在这一步,Windows显示了一条“现在可以安全地关闭计算机”的消息,您必须自己按下物理电源按钮。1996年首次发布的ACPI(高级配置和电源接口)标准允许Windows关闭PC电源。 相关:是的,可以用电源按钮关闭电脑 这与使用...

  • 发布于 2021-04-04 05:00
  • 阅读 ( 220 )
江D晶晶
江D晶晶

0 篇文章

相关推荐