C++:我什么时候应该使用 _disable() _enable()

C++: When should i use _disable() _enable()

Visual Studio 允许指令清除处理器中断标志以禁用或启用(参见 link)。什么时候,推荐使用此类工具。特别是在性能方面。 https://msdn.microsoft.com/en-us/library/tzkfha43.aspx

在你的情况下,永远不会。只是忘记它的存在。 :)

_disable()_enable()分别用于禁用和启用中断。

Read more about interrupts here.

如果您是 C++ 初学者,您可能不需要这个,除非您的目标是编写操作系统内核。