• 0 Posts
  • 12 Comments
Joined 1 year ago
cake
Cake day: November 20th, 2024

help-circle

  • In fact, I think you’d be better off writing a deep dive into what/how environment variables work at build time, and also invoking commands on the CLI.

    But LD_PRELOAD doesn’t really have much to do with build time behavior (unless you’re talking about replacing parts of the compiler) - it allows you to force a shared library to be loaded with higher priority than anything else, so it overrides symbols from other libraries.

    It is recognized and used by Linux’s dynamic linker, which is run-time, not build-time.






  • I guess how much people care also depends on whether they tend to use laptops in ways and places that are prone to causing damage to the ports. I’ve never damaged any port on any laptop I’ve ever owned, and it’s unlikely I ever will because I like to keep the cables organized and out of the way (so it would require conscious effort to tug on them), and when I want to pick my laptop up, I always quickly run my hand around its perimeter to make sure everything is disconnected.

    I do not claim that this is the correct way to use a laptop or that others should do the same, it is a tool that should be used the way its user needs, I just want to point out that for some usecases, this is simply a non-issue in the same way a non-replaceable CPU is - nothing’s going to happen to it.

    Also, my current laptop does have both a barrel jack (probably works, I’ve never used it) and a USB-C charging connector, so it’s not necessarily an either-or proposition.




  • Virtual memory isn’t swap, it is a mechanism that allows the operating system to give processes a view of memory that is almost completely decoupled from real physical memory and other processes. For example some programs require their code and data to be placed at exact memory locations in order to work - virtual memory allows you to run as many of these programs as you wish, because one process’s address 0x1000 has nothing to do with another one’s 0x1000, unless they set it up as shared memory (but even the same chunk of shared memory might be mapped to different addresses in the processes that share it).

    Swapping is a cool trick that you can do with virtual memory, though. Basically you store a piece of memory somewhere outside the physical memory, and then make the address invalid in virtual memory. When the process tries to access it, it will crash. The OS will be notified of the crash, see that it was due to the process trying to access swapped out memory, load the chunk back from disk (maybe to a different physical location), update the virtual memory to correctly point to this chunk, and restart the crashed process from the instruction that caused the crash. So from the point of view of the process, nothing went wrong at all, except that one instruction took a very long time to execute.

    Also, isn’t it harmful to SSDs?

    Swapping doesn’t do enough writes to matter, unless your system is running really low on RAM.





  • I don’t think overheating would cause random corruptions (it should throttle down when overheating, and then shut down if the temperature gets too high even when throttled, but there should never be an incorrect result of any computation), and surely the RAM will run at the standard 2133 speed on default settings - OP says they reset the BIOS settings to default between CPU swaps.