Skip Navigation

Posts
2
Comments
99
Joined
2 yr. ago

  • Perfect is really doing some heavy lifting. Sure shes better. I would have voted for her if i was an US-American. But shes still garbage. She kind of is controlled opposition. Making us look away from what would be actually good vs whats better than the worst option. It serves to legitimize their position in fear of the alternative. Thats not democracy. I am not saying that you should not vote, endorse or even accept the shitstain we get in the USA that is represented by Trump but running to the Democrats as the goal or seeing voting as the primary political action is a big blunder in my eyes. (again do vote).

  • I'd prefer there be less positions of power to stomp on women.

  • Shamefully i referred to myself as basically fitting the label "meatlover" before going vegan. I feel like if i did it, everyone can. Sure cheese replacement does not taste as cow cheese and deaths still occour but those deaths aren't the product and if I wanted more such deaths I'd just eat tons of meat as they need to be fed and grow using a substansial amount of food.

    The less animal products the better but you are able to make a choice not to voluntarily exploit them. Also while im not sure if you are implying that you want to wait until lab grown meat is available to the end consumer. If you do thats kind of saying "I will only make such choice if there is basically no effort in doing so" to me.

  • Don't want to be associated with liberals nor MAGA.

  • Didn't even realize it was a brand. I thought it tried to say essentials to remember. Why even include brands in drawings at all?

  • Idk but the political compass is generally not a good model for understanding politics anyway.

  • I didn't know walls could be liberal O_O

  • Teaching liberals the word "tankie" was a mistake...

  • I mean... I want the war not to go well for the USA.

  • For anyone interested, I did make a second version of the same logic. Even if i kind of had atomic operations in mind i did not know that i was thinking of atomic or what atomic was for that matter. So in a broad sense i assumed raw pointers were atomic. Also worth noting implementing a false Sync for &str seemed to be unnecessary to get it to run in the first example even if i got the impression during construction that it was. Just pretend in the first example "ExemptSyncStringSlice" is just &str if you want to compare them for some reason.

    I don't know the overhead of AtomicPtr compared to raw pointers and it is dependent on operating systems that can use an atomic load store (whatever that means.) But this version seems more "correct" at least.

     use std::thread::{self, sleep};
        
    use std::sync::atomic::{AtomicPtr, Ordering};
    use std::time::Duration;
    
    
    fn main()
    {
    	let pointer: AtomicPtr<&'static str> = AtomicPtr::new(&mut "Hello!");
    
    	let mut value2: &'static str = "Hi!"; // Place outside scope due to lifetime.
    
    	thread::scope(|scope|
    	{
    		scope.spawn
    		(|| {
    			for _ in 1..1000
    			{
    				unsafe { println!("String = {}",  *pointer.load(Ordering::Relaxed)); }
    			}
    		});
    
    		scope.spawn
    		(|| {
    			sleep(Duration::from_millis(1));
    			pointer.store(&mut value2, Ordering::Relaxed)
    		});
    	});
    }
    
    
      

    Thank you all who responded btw.

  • Well worst case to come with language design i could always learn assembly ;) Half joking but thank you very much for your answer. As for the example the only reason its rust is i figured it would be the easiest language to get the logic right even if i have more hours in C++ technically. Arrays seemed obvious enough that would break but i was unsure about things like pointers and integers. Just find the "lower" levels kinda fun ngl.

  • Hm. Good to know. As far as i know. rusts unsafe is kind of like sudo where more tools are granted to you with less checks and balances. Those checks being the borrow checker. So I think unsafe is more like saying "I don't want the extra protection against bad memory use." (Like say using memory you already freed). Now im not familiar with what makes a variable atomic or not. But assuming if a variable can be read or written with a single instruction. I'm interpereting that as making it safe?

  • Thank you for replying so quickly. Very interesting that it writes 64 bits at a time. (at least on the x86_64 platform i am on) So theres no tangible risk of a cpu processing a read and write instruction in parallel messing up the data that was read?

  • Learn Programming @programming.dev

    During Data Races: What Is the Risk of Accessing Half-Written Variables? Is There Any?

  • Knut Hamsun... That sounds very norwegi- ...of course

  • Fuck!

    I hate USA. I hate ISIS. I hate Turkey and the new Syrian Government too.

  • Not completely sure if you're referring to ML's or this meme but means and ends was published in 2023

  • oops

    Jump
  • This is why i find rmdir useful.

  • Fuck Cars @lemmy.world

    Article: Why Roadless Areas Matter for Wilderness Preservation

    www.counterpunch.org /2025/09/12/why-roadless-areas-matter-for-wilderness-preservation/