[HN Gopher] How to Make Rust Leak Memory (Also: How to Make It S...
___________________________________________________________________
How to Make Rust Leak Memory (Also: How to Make It Stop)
Author : fasterthanlime
Score : 10 points
Date : 2022-06-15 20:02 UTC (2 hours ago)
(HTM) web link (fly.io)
(TXT) w3m dump (fly.io)
| mwcampbell wrote:
| This is super tangential, but does anyone else find it sad that
| operating systems receive keys from USB keyboards using polling
| rather than interrupts? Wouldn't comprehensive use of interrupts
| rather than polling allow the processor to move to a lower-power
| state? No wonder our closed smartphones are more battery-
| efficient than our open PCs.
| Findecanor wrote:
| There is a common misconception that the host would be polling
| the keyboard state, always. It is actually polling to ask the
| device if it has a new packet to send. If the keyboard's state
| hasn't changed then there is no new packet and there isn't any
| input processing done by the CPU. (This scheme is actually
| called "Interrupt" in the USB standard, BTW)
|
| The host polls because _it_ is in control of scheduling all
| activity on the bus. It must be scheduled because there can be
| multiple devices (and multiple interfaces per device) with
| different characteristics on the same bus, and they must be
| kept from interfering one-another.
| TingPing wrote:
| You think polling at 500hz has a meaningful impact on your CPU?
| [deleted]
___________________________________________________________________
(page generated 2022-06-15 23:02 UTC)