當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
  • 閱讀 ( 35 )
  • 分類:網際網路

你可能感興趣的文章

如何在windows10上設定區域網喚醒

喚醒區域網(WoL)是Windows 10作業系統中未得到充分重視和使用不足的一部分。 ...

  • 發佈於 2021-03-11 17:00
  • 閲讀 ( 45 )

管理和控制windows關閉的4個工具

...是當它引起諸如丟失工作或停止下載之類的煩惱時。就連windows10也加入了進來,當你沒有要求你的計算機重新啟動來安裝更新時,它會強迫你重新啟動計算機。 ...

  • 發佈於 2021-03-13 02:27
  • 閲讀 ( 41 )

關閉時windows可以自動清除的5項內容

... 對於某些程式,Windows將跟蹤您最近檢視的檔案。例如,開啟類似Microsoft Word的內容,然後在工作列上右鍵單擊它。跳轉列表將顯示您最近的所有文件。我們可以使用登錄檔編輯器在關機時...

  • 發佈於 2021-03-13 06:17
  • 閲讀 ( 46 )

有史以來最可笑的12個錯誤

...些關係產生了一些有趣的情況,新手使用者無法掌握使用Windows的基本知識。在這方面,是錯誤訊息。當計算機遇到意外情況時,它通常會丟擲一個訊息框供使用者檢視。 ...

  • 發佈於 2021-03-16 17:56
  • 閲讀 ( 63 )

windows無法正確安裝?解決所有常見問題的5個技巧

... 我們是來幫忙的。由於Windows安裝問題的性質,我們不能提供一個特定的過程來解決每一種情況。相反,我們將看幾個提示,在Windows安裝不正確時嘗試,然後介紹一些最常見的錯誤訊息。 ...

  • 發佈於 2021-03-22 08:33
  • 閲讀 ( 49 )

usb over ethernet:您不使用的最強大的系統

... USB/IP:Windows和Linux。只有免費程式。我們無法在測試中使用它,但是一個免費的應用程式總是值得一試。 乙太網USB:僅限Windows。具有成本效益。 網...

  • 發佈於 2021-03-26 11:31
  • 閲讀 ( 50 )

如何解決計算機硬體問題

...題不妨礙您登入作業系統,它可能會有所幫助。例如,在Windows10中,裝置管理器可以提醒您潛在的硬體問題,如缺少或不相容的驅動程式。 ...

  • 發佈於 2021-03-27 01:18
  • 閲讀 ( 51 )

如何控制mac電腦何時自動進入睡眠狀態

...間後,您的Mac電腦將進入“待機”狀態。它的工作方式與Windows PC上的休眠模式類似。Mac電腦會將其記憶體內容儲存到磁碟以節省額外的電源,但從待機狀態恢復所需的時間比從睡眠狀態喚醒所需的時間更長。 下面是如何自定義...

  • 發佈於 2021-04-01 17:16
  • 閲讀 ( 57 )

如何使用lynis稽核linux系統的安全性

如果您使用Lynis在Linux計算機上執行安全審計,它將確保您的計算機受到儘可能多的保護。安全是網際網路連線裝置的一切,所以這裡有如何確保您的安全鎖定。 你的linux電腦有多安全? Lynis執行一套自動化測試,徹底檢查Linux...

  • 發佈於 2021-04-02 03:25
  • 閲讀 ( 44 )

如何對無法載入的網頁進行故障排除

...請確保裝置未處於飛航模式。在智慧**、平板電腦和許多Windows桌上型電腦和膝上型電腦上,您可以禁用所有通訊。一些Windows膝上型電腦也有專用的飛航模式鍵,你可能會誤按。所以,仔細檢查你的裝置設定,以防萬一。 如果您...

  • 發佈於 2021-04-03 06:06
  • 閲讀 ( 61 )
江D晶晶
江D晶晶

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦