5 ms·
While it is clearly a joke, it has a legitimate use as a syscall that does nothing so can be used to test the syscall process itself [1]. (Its cousin `is_comput
by lifthrasiir 5y ago
While it is clearly a joke, it has a legitimate use as a syscall that does nothing so can be used to test the syscall process itself [1]. (Its cousin `is_computer_on_fire` is not a syscall.)
[1] https://github.com/haiku/haiku/commit/ccaac177f64038c160de6f22f99d472c96e6ac7d https://github.com/haiku/haiku/commit/ccaac177f64038c160de6f...
- tialaramex 5y agoSure. Of course, one important trick here is that no matter how fast your system call is, not making a system call is just faster. io_uring is an example, as are futexes. So it's worth spending more effort on figuring out tricks to avoid doing the system call than exploiting tricks to shave a cycle or two off the time taken to execute one.
- spicybright 5y agoCompletely depends on your use case. If you're checking if sys calls work, you'd only need to run one first and see if it succeeds. Then you can be reasonably sure you have access to the rest. And different programs have different speed requirements.
- draw_down 5y agoI suppose not checking whether syscalls work would indeed be faster than checking whether they work...
- jrumbut 5y agoI was thinking the same thing, although in reverse: Imagine putting a few of these in as a joke and then you take it out and your parallelized code doesn't work anymore. Not sure how all that's handled on Haiku specifically.
- marcodiego 5y agohttps://xkcd.com/1172/ https://xkcd.com/1172/
- phlakaton 5y agois_computer_on_fire goes all the way back to the early days of BeOS IIRC. I'm sure full backwards compatibility has been _very_ carefully considered.
- sillysaurusx 5y agoWhy isn’t is_computer_on_fire a syscall? That’s fascinating that two joke functions differ so dramatically.