is_computer_on_fire() seems more usable...
How to programmatically find out if computer is on
71–80 of 197 posts
Re: How to programmatically find out if computer is on
#72While 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/ccaac177f64038c160de6f...
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.
Re: How to programmatically find out if computer is on
#73Re: How to programmatically find out if computer is on
#74Functional programming with monads is the right way to implement this.
Re: How to programmatically find out if computer is on
#75> is_computer_on() How does this relate to computer being in Halt state, which is quite valid state for servers (there could be even a dedicated Halt button)? Technically computer hardware is ON. I remember that in such state it shows a "carrot" prompt (>>>) from the SRE console. By the way, there is also HCF instruction (Halt and Catch Fire). https://en.wikipedia.org/wiki/Halt_and_Catch_Fire_(computing...
Re: How to programmatically find out if computer is on
#76While 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/ccaac177f64038c160de6f...
Sure. 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.
And different programs have different speed requirements.
Re: How to programmatically find out if computer is on
#77While 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/ccaac177f64038c160de6f...
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.
Re: How to programmatically find out if computer is on
#78"I compute, therefore I am on"
Re: How to programmatically find out if computer is on
#79While 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/ccaac177f64038c160de6f...
I 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.