I noticed that in the Linux kernel 2.4 file sched.c there's a line that says:
void scheduling_functions_start_here(开发者_StackOverflow中文版void) { }
and one that says
void scheduling_functions_end_here(void) { }
Shouldn't this kind of stuff be written as a comment? What is the gain of using functions?
Ok, I just did some googling, and can now somewhat back up my comment. Check out process.c, line 439 onwards.
I don't read C too well, but it looks like it needs to check whether a thread is in a scheduling function or not.
I'm not a Linux kernel author, but the most likely answer is that function names are more likely to appear in an IDE's file index than comments are.
精彩评论