|
|
|
|
|
by AceJohnny2
3401 days ago
|
|
> In other words: your system supports calling the time system call via the Linux kernel’s vDSO to avoid the cost of switching to the kernel. But, as soon as your program calls time, it calls localtime immediately after, which invokes a system call anyway. This reminds me of an article by Ted Unangst[1], in which he flattens the various libraries and abstractions to show how xterm (to cite one of many culprits) in one place is effectively doing: if (poll() || poll())
while (poll()) {
/* ... */
}
In other words, if you don't know what your library/abstraction is doing, you can end up accidentally duplicating its work.Reminds me of some aphorism, "Those who do not learn from history..." ;) [1] http://www.tedunangst.com/flak/post/accidentally-nonblocking discussed https://news.ycombinator.com/item?id=11847529 |
|