linux-kernel - Linux 内核进程切换的switch_to函数为什么要有三个参数?
天蓬老师
天蓬老师 2017-04-17 13:37:04
0
1
542

《Understanding Linux Kernel》第三章中说的进程切换switch_to宏的执行要有prev,next,last三个参数。对于last参数书中大概是这样说的:如果没有last参数,比如A进程->B进程->C进程->A进程,代表进程A执行的内核就失去了对C的任何引用。

但我想问的是为什么要得到C的引用?我不是问怎么得到C的引用(网上已经有很多关于last这个参数如何得到C进程的引用的讨论)

系统有一个进程链表,里面自然有C进程的信息。我觉得A不用C的引用,A只要能继续执行就好了,A和C有什么关系呢?
先谢谢了!

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(1)
大家讲道理

Don’t know. It may be related to the specific system
After reading the UNIX V6 textbook, its swtch function does not need to record the process before switching

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!