为什么我写的c++程序在windows下比linux下要快,linux比windows快很多倍除了算法的优势 有没C比C++快的原因?...
該樓層疑似違規已被系統折疊?隱藏此樓查看此樓
C和C++混合的,當然還有匯編
引用:
Most of the source code for Windows NT is written in C or C++. These
high-level languages make it relatively easy to port Windows NT to
different types of workstations. The same source code can be recompiled
to build versions of Windows NT that are specific to each processor's
instruction set.
A small amount of the code in Windows NT is written in
assembly language. Typically, this is code that either interacts
directly with a computer's hardware, or needs to run extremely fast.
Because assembly language is specific to a particular instruction set,
this code must be rewritten once for each type of processor on which
Windows NT will run. To make it easy to locate and maintain, this code
is isolated to just a few key places in the operating system:
The kernel is the heart of the Windows NT operating system.
It controls which threads are run on the system's processor(s), and
provides synchronization mechanisms that allow threads on multiple
processors to coordinate their access to operating system data
structures. It also dispatches interrupts and exceptions to the
appropriate handler routines. To optimize the speed of these
system-critical operations, portions of the kernel are written in
assembly language.
總結
以上是生活随笔為你收集整理的为什么我写的c++程序在windows下比linux下要快,linux比windows快很多倍除了算法的优势 有没C比C++快的原因?...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux内核 mpls,将MPLS编译
- 下一篇: ec6110刷linux系统,华为EC6