Hacker Newsnew | past | comments | ask | show | jobs | submit | spacechild1's commentslogin

Yes. How do so many people fall for this guy? I find him pretty creepy, to be honest.

Pretty sure he’s a complete fraud too. He associates himself with MIT despite only having had a short stint teaching non-credit classes. One of his papers was apparently so flawed it’s been wiped from existence. Plenty of info online if you want to go down the rabbit hole.

FWIW C++ has quite a few async I/O libraries that support io-uring. For example, ASIO has had a io-uring backend since 1.21 (late 2021).

Except Trump himself repeatedly claimed that the exporting country is paying the tariffs and that the US is earning billions of dollars. And many of his followers seem to believe this.


Might be collecting lots of money as tariffs but they’re acting as a national sales tax. Defrays the cost of the tax cuts to some degree I guess.

Right, someone has to pay for these tax cuts eventually. The rich certainly won't.

Not in other languages. In German, for example, it would very weird to think of railroads (Bahn/Eisenbahn/Bahnstrecke) as roads (Straßen). Would you also claim that a hedgehog is a pig?

But autobahn is a road, no?

Yes, but "Bahn" actually means "track", "path" or "lane". "Bahn" in the sense of "railroad" is an abbreviation of "Eisenbahn" (literal translation: "iron tracks"). So "Autobahn" has nothing to do with railroad, it just means "car track".

Only by name.

The US military is famous for purely acting in self defence...


The whole movie is a bribe from Jeff Bezos to Trump so it would only be consequent to also bribe the audience.


like who?


Nice article! Yes, using spinlocks in normal userspace applications is not recommended.

One area where I found spinlocks to be useful is in multithreaded audio applications. Audio threads are not supposed to be preempted by other user space threads because otherwise they may not complete in time, leading to audio glitches. The threads have a very high priority (or have a special scheduling policy) and may be pinned to different CPU cores.

For example, multiple audio threads might read from the same sample buffer, whose content is occasionally modified. In that case, you could use a reader-writer-spinlock where multiple readers would be able to progress in parallel without blocking each other. Only a writer would block other threads.

What would be the potential problems in that scenario?


I've heard of issues on Arm devices with properly isolated cores (only one thread allowed, interrupts disabled) because the would interact with other threads using such a spinlock, threads which were not themselves isolated. The team replaced it all with a futex and it ended up working better in the end. Sadly this happened while I was under another project so I don't have the details, but this can be problematic in audio too. To avoid the delay of waking up thread you can actually wake them a tiny bit early and then spin (not on a lock), since you know work is incoming.


For task queues we would use a lockfree queue, wake up the threads once at the beginning of the audio callback and then spin while waiting for tasks, just as you described.

My example above was rather about the DSP graphs themselves that are computed in parallel. These require to access to shared resources like audio buffers, but under no circumstance should they give up their timeslice and yield back to the scheduler. That's why we're using reader-writer spinlocks to synchronize access to these resources. I really don't see any other practical alternative... Any ideas?


I suppose you need to be able to read data from the buffers to know what parts of the graph to cull? Is computing the graph really long or the graph needs update mid execution? If you really have nothing else to do on those threads/cores, spinning might actually be the solution(considering a high sampling rate). I'd still fallback to the OS after a certain amount of time, as it would mean you failed to meet the deadline anyway. I would also reduce as much as possible the need for writes to synchronized resources where possible, so that you can just read values knowing no writes can happen during your multiple reads.


Recently implemented a fixed-size memory pool with spinlocks and now I'm wondering - how would one implement them without a spinlock?

Edit: Maybe I'm confusing terminology. What I'm doing is looping until other threads returned memory, but I'm also doing a short sleep during each loop iteration.


That's a spin loop ;)


I see, thanks.


I'd like to see you stay calm when you suddenly get peppersprayed directly in the face and wrestled to the ground.


Well, exactly. My recommendation would be not to carry a gun where there is law enforcement already there. Or if you do, don't resist capture.

I.e, I maintain that this was an accident. The police didn't want to shoot this person, nor did the person want to use his gun. But it appeared like that to both sides which then caused the event that followed.


I'm not claiming that the ICE agent wanted to shoot Alex. I think the shooting itself was a case of gross incompetence. However, they intentionally attacked and assaulted Alex without any immediate reason. How are supposed to stay calm when you get peppersprayed in the face out of the blue?


The confiscated gun went off and the officers thought it came from the person being detained so they shot him. Waiting out to be shot would have been incompetent had he really been shooting.

Alex put hands on the officers first so there was an apparent reason.


> The confiscated gun went off

Do you have any source for this? If that was the case, the DHS would have reported it as it would support their narrative.

> Alex put hands on the officers first so there was an apparent reason.

This not true! Alex moved in front of the ICE officer who just violently pushed the woman to the ground. He had this cell phone in his right hand and he raised his left hand in a protective manner. He does not even appear to touch the agent at any moment. This is when he got peppersprayed in the face. Then he tried to help the woman up. This is when an agent grapples him from behind and Alex gets wrestled to the ground. At no point did he behave in a threatening manner! You can clearly see this in the videos.

For example: https://abcnews.go.com/Politics/minute-minute-timeline-fatal...


I think he did have his hand(s) on the officer right after he raised it. To me this "protective raise of the hand" looked like taking his hands off of the officer. Also, while Alex may have had protectiveness as a thought in his head this may have not seemed so to the officers.

Regarding shooting, what seems clear that shooting started after the gun was taken from Alex. At the discovery of it an officer also shouted "gun", after this guns were drawn and then shots were fired. Which gun went off first doesn't appear from the videos, but after the first one did, I assume that the rest of the shooting was due to the first shot being interpreted as the victim starting shooting, as not all of the officers saw that the gun had already removed.

Still, don't bring a gun to a protest, don't engage in any physical activities with law enforcement, don't stop them from doing their work, don't walk and whistle along..


So why did you claim Alex' gun went off? You have been spreading gross misinformation. Maybe take a step back and reflect before you come up with new theories.


I'm sure it will be known soon-ish where the first shot came from. It's just that the first one likely caused the rest of it as the surrounding officers didn't know who was shooting.

Say it turned out that the first shot was fired due to an officer misinterpreting something for a gun, because "gun" was yelled, would that turn this into anything else than an accident?

The best way to appear not to have a gun, nor appear dangerous at all, is not bring a gun to a protest.


Again, why did you claim that Alex' gun went off as if that was a fact?

> It's just that the first one likely caused the rest of it as the surrounding officers didn't know who was shooting.

No need to speculate. If you watch https://youtu.be/i8kFcK-X-vQ?t=108 you will see that the first agent shoots Alex in the back one time and another three times while they all move away. Note that Alex has been restrained the whole time. One second later, you hear 6 more shots. This is where the second agent got involved. At this point, Alex has already been lying on the ground.

> because "gun" was yelled, would that turn this into anything else than an accident?

At best this was an accident, but even then it was the agents fault for misinterpreting the situation or the DHS's fault for deploying badly trained agents. (Hearing the words "Gun!" does not give officers the permit to shoot, unless they perceive an imminent threat to their or someone else's life!) However, if you watch the video above, you can see that an agent removes Alex' gun right in front of the agent who fires the first shots. There are lots of open questions.

> The best way to appear not to have a gun, nor appear dangerous at all, is not bring a gun to a protest.

The act of conceiled carrying alone does not make you a threat. Alex never behaved in a threatening way.

Instead of putting the blame solely on Alex, maybe ask yourself what the agents could have done to deescalate the situation, what kind of people the DHS recruits as ICE agents and if their training is appropriate for urban policing.


> Again, why did you claim that Alex' gun went off as if that was a fact?

This seems to be what people suspect. It's less likely that an officers own gun goes off as they are familiar with it.

I don't put blame on Alex, solely (read!). But the ill meaning callouts of ICE being this and that, occupation, isn't correct either. I don't think you people in the US have actually lived under an occupation, so these words are easy to use.

Regarding being threatening: well, if you carry a gun to a protest and engage physically with an officer (subjectively and to me) is threatening. It also seemed threatening to the shooting officers.


> This seems to be what people suspect.

Who? Not even the DHS people claim this! And why did you initially present it as a fact?

> It's less likely that an officers own gun goes off as they are familiar with it.

Again, you can clearly see/hear on the video that the agent fires the first shot. No gun went off. Why do you make stuff up?

> It also seemed threatening to the shooting officers.

I very much doubt it. At the best the agents were just badly trained and did not know how to handle someone who carries a gun (in a state that allows conceiled carrying).


I presented it initially because this has been what people think: https://youtu.be/QePoawDA_48?si=0mr-lMR_lIRoBDA_ There are many more people opining this, both as these more produced videos to simple social media postings. I still do present you the opinion that likely the confiscated gun went off which started the rest of the shooting.

The first shot is not "clearly seen" as far as I can tell.

If Pretti, and the first fired shot, didn't seem threatening then the shooting wouldn't have happened..

I'm happy that you know how law enforcement works, how to behave in critical situations and that it actually is possible to have perfect awareness of any situation. If you are this good, I'd suggest to join the force yourself, as you have a clear advantage in doing that kind of work.

This video ties my non-professional opinion well into the US legal fabric https://youtu.be/QePoawDA_48?si=0mr-lMR_lIRoBDA_.


> I presented it initially because this has been what people think:

Maybe in some MAGA podcast circles. This has never been more than pure speculation. Again, why did you present it as a fact?

Let's assume the gun went off. I'm sure the person holding that gun would have noticed that. Why wasn't this reported, especially as it would support their case? This just doesn't make any sense at all.

> The first shot is not "clearly seen" as far as I can tell.

It very much is. Did you even watch the video I've linked? It shows the very moment the first shot is being fired. Are you seriously claiming it is not the agent who is firing that shot? Again, not even the DHS is disputing that the agent fired the first shot.

Stop making a fool of yourself.


Here is at least some video infication that Pretti's gun did go off: https://youtu.be/JFSBPEQYSFE?si=hWz6bthbUtOmprhh

There'll likely be a deeper investigation and a report to say whether that's true or not.


That video does not show anything. Stop being ridiculous! Again, don't you think the agent who took the gun would have noticed that it went off?

That's not a serious theory that needs investigating. I have no idea where you're getting all your "information" from, but I can tell you that you need to reflect on your media consumption. You're in a bubble.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: