• 0 Posts
  • 29 Comments
Joined 2 years ago
cake
Cake day: September 24th, 2023

help-circle
  • The linked patch actually explains it really well.

    If you want two processes to communicate (IPC) normally, you would set up some shared memory, so that in each process’s virtual memory some pages are shared between them both, so when process A writes to that memory it is visible to process B and vice versa. There are other ways to do IPC but this is the fastest since it doesn’t involve any syscalls (context switch to the kernel which is slow).

    However it still requires each process to copy its private data into and out of the shared memory. Also it still requires a context switch from process A to process B.

    A common use of IPC is for RPC (Remote Procedure Calls). Basically you want to run a function in the other process. This solution does that but differently and faster.

    1. First, both processes share the same virtual memory. This is normally a recipe for disaster since it completely destroys the normal process memory sandboxing (a memory error in one process can now crash the other one!). However they use a new Intel MPK hardware feature that allows splitting the pages into one of 16 groups (“keys”), and you can control read/write access to each group independently.

    2. Next when process A wants to call a function in process B, the RPAL code does a lightweight context switch in user space. I guess this just means changing the MPK key, and normal saving of registers for the function call. I’m not sure what else you’d need to change. It’s a little unclear about how you pass heap data from process A to process B. I guess both processes just have read access to the entire address space? That doesn’t really change the security model on Unix since any process can already debug any other process with no extra permissions.

    It sounds very similar to running two processes as if they were threads in the same process. Why not just use threads? Probably a better option if you can, but I guess if you are e.g. running processes written in different languages that might be tricky?





  • Nah AI can be extremely useful for learning technologies. You just need to be careful to verify they aren’t bullshitting you.

    For example find an explanation of PPM compression that is concrete and simple. As far as I can tell it doesn’t exist.

    But I could ask ChatGPT and it told me how it works (probably) in just a few seconds. I haven’t verified yet (at a BBQ) whether it is the correct algorithm but it’s certainly a plausible one that would work.

    It told me that you use a trie (typically) of symbol prefixes to record the probability of the following symbols, so for example you know that for the prefix “Th” the probability of “e” is 90%. Then you encode the symbol with arithmetic coding using the modelled probabilities. Apparently the typical max context length is 4-6.

    That would have taken me hours to find by reading code and ancient papers but I can verify it a lot quicker.







  • Not the case. There are binary components.

    It doesn’t matter though because the Clangd & CodeLLDB extensions completely replace it and are actually waaaaaaay better.

    With Microsoft’s C++ extension it always rinsed the CPU - there were files I had to avoid opening because then it would analyse them and I’d have to kill it. The code intelligence also seemed very “heuristic” and was quite slow.

    Clangd fixes all of that. It’s fast, doesn’t choke on huge files, and if you have compile_commands.json it’s actually the first properly fast and robust C++ IDE I’ve ever used. You know if you’ve used a Java IDE the code intelligence just works and is fast and reliable. It’s like that.








  • Yes it is. People praise the car as the ultimate freedom because they imagine that they can take that car anywhere.

    They can!

    But the moment they have a problem with their car, they literally can’t go anywhere.

    Nobody is under the illusion that cars never break! Come on dude. Trains and buses are hardly infallible either!

    Everyone has a story about how their car didn’t start, or about the mechanic that didn’t actually fix the problem, or how they’re still waiting on a part and can’t fix it until tomorrow.

    Everyone has 10 stories about trains being cancelled or buses not showing up. That’s life. Completely irrelevant to the fact that cars give you independence.

    How many times has your train derailed? Is this a common problem in your life?

    Obviously I was not talking about actually derailment. That was obvious to anyone not being deliberately stupid. Trains are delayed or cancelled all the time. Much more frequently than cars break down.

    It’s becoming clear that you live somewhere where there are no trains or buses so you have no actual experience of them and imagine them to be perfect.


  • like asking for multiple options when it comes to transportation

    No, like trying to say that cars don’t give you independence because they need insurance and servicing. That’s simply not the kind of independence people are talking about.

    It’s like saying metro systems aren’t convenient because they are really difficult to build. It’s confusing two different things.

    A car breaking down can completely derail an individual’s day.

    So? You know what can also derail your day?