Điều gì đang thực sự xảy ra khi một máy tính Windows tắt?

Mục lục:

Điều gì đang thực sự xảy ra khi một máy tính Windows tắt?
Điều gì đang thực sự xảy ra khi một máy tính Windows tắt?

Video: Điều gì đang thực sự xảy ra khi một máy tính Windows tắt?

Video: Điều gì đang thực sự xảy ra khi một máy tính Windows tắt?
Video: Cách âm thầm theo dõi vị trí của người khác bằng google maps theo thời gian thực - YouTube 2024, Tháng tư
Anonim
Trong khi hầu hết chúng ta có thể suy nghĩ rất ít về tất cả những gì đang xảy ra mỗi khi chúng tôi tắt máy tính của chúng tôi, những gì đang thực sự xảy ra 'dưới mui xe' trong quá trình tắt máy? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời cho câu hỏi của người đọc tò mò.
Trong khi hầu hết chúng ta có thể suy nghĩ rất ít về tất cả những gì đang xảy ra mỗi khi chúng tôi tắt máy tính của chúng tôi, những gì đang thực sự xảy ra 'dưới mui xe' trong quá trình tắt máy? Bài đăng Hỏi & Đáp của SuperUser hôm nay có câu trả lời cho câu hỏi của người đọc tò mò.

Phiên Hỏi & Đáp hôm nay đến với chúng tôi theo lịch sự của SuperUser - một phân khu của Stack Exchange, một nhóm các trang web Hỏi & Đáp do cộng đồng điều hành.

Câu hỏi

Trình đọc siêu người dùng RACING121 muốn biết điều gì thực sự xảy ra khi máy tính Windows tắt:

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

What is actually going on during this stage?
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?

Điều gì thực sự xảy ra khi một máy tính Windows chạy qua quá trình tắt máy?

Câu trả lời

Những người đóng góp của SuperUser Keltari và zzarzzur có câu trả lời cho chúng tôi. Đầu tiên, Keltari:

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

  • Checking to see if any user applications 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 applications 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)

Tiếp theo là câu trả lời từ zzarzzur:

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 notifications. 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 notifications 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% races -postBootDelay 180 -traceFlags base

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

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

Sources

Windows On/Off Transition Performance Analysis Document [Microsoft]

Windows On/Off Transitions Solutions Guide Document [Microsoft]

Có cái gì để thêm vào lời giải thích? Tắt âm thanh trong các ý kiến. Bạn muốn đọc thêm câu trả lời từ những người dùng Stack Exchange có hiểu biết công nghệ khác? Xem toàn bộ chuỗi thảo luận tại đây.

Đề xuất: