《操作系统》库函数与系统调用的区别和联系?
庫函數是語言或應用程序的一部分,可以運行在用戶空間中,而系統調用是操作系統的一部分,是內核為用戶提供的程序接口,運行在內核空間中,而且許多庫函數都會使用系統調用來實現功能。
Library function is a part of language or application program, which can run in user space. System call is a part of operating system and is the program interface provided by kernel for users. It runs in kernel space, and many library functions will use system call to realize functions.
未使用系統調用的庫函數,其執行效率通常要比系統調用的高,因為使用系統調用時,需要上下文的切換以及狀態的切換(由用戶態轉為內核態)。
The execution efficiency of library functions without system calls is usually higher than that of system calls, because context switching and state switching (from user mode to kernel mode) are required when system calls are used.
總結
以上是生活随笔為你收集整理的《操作系统》库函数与系统调用的区别和联系?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 316. Remove Duplicat
- 下一篇: Windows 10每天定时执行脚本