• 8 Posts
  • 145 Comments
Joined 1 year ago
cake
Cake day: April 27th, 2023

help-circle


  • The only time I’ve ever needed a Mutex<()> so far with Rust is when I had to interop with a C library which itself was not thread safe (unprotected use of global variables), so I needed to lock the placeholder mutex each time I called one of the C functions.

    Actually I think in this case you’re still better off using a Mutex with “data” inside. I’ve done this before. The idea is that you make a unit struct MyCFuncs or whatever and then you only call the C functions from methods of that unit struct. Then you can only access those methods once you lock the Mutex and get the instance of the unit struct. It feel elegant to me.




  • it wouldn’t make sense for the server to hold your private key, since that would mean the owner of your instance could make posts as you.

    I mean, this is quite normal and common for all traditional social media (or any site really) you sign up for. It’s what most ActivityPub instances do too, though there’s nothing in ActivityPub that requires the server to hold the private key. It could in principle be held by the client but I don’t believe there is any implementation that does that currently.