3 ms·
Excerpt: "...I mean, how often do you have one thread spinning for several seconds in a seven-instruction loop while holding a lock that stops sixty-three other
by peter_d_sherman 7y ago
Excerpt:
"...I mean, how often do you have one thread spinning for several seconds in a seven-instruction loop while holding a lock that stops sixty-three other processors from running. That’s just awesome, in a horrible sort of way."
I respectfully disagree.
That's because everything in the universe that is percieved as negative -- turns out to have a positive use-case somewhere, sometime, in some context...
In this case, I think the ability for one core to stop 63 other processor cores is purely awesome, because think of the possible use-cases! Debugger comes to mind immediately, but how about another if let's say there are 63 nasty self-resurrecting virus threads running on my PC? What about if you were doing some kind of esoteric OS testing where you needed to return to something like Unix's runlevel 1 (single user), but you'd rather freeze most of the machine (rather than destroying the context of everything else that was previously running?).
Oh, here's the best one I can think of -- don't just do a postmortem, everything's dead core dump when something fails -- do a full (frozen!) "live" dump of a system that can be replayed infinitely, from that state!
Now, because I take a contradictory position, doesn't mean we're not friends, or that I don't acknowledge your technical brilliance! Your article was absolutely great, and you are absolutely correct that for your use-case, "That’s just awesome, in a horrible sort of way.".
But for my use-cases, it's absolutely awsome, in the most awesome sort of way! <g>
- lilyball 7y ago63 cores blocked on a single mutex is not at all like any of the scenarios you're describing. That's almost like describing the notre dame fire as having a positive use-case because what if you want to do a controlled demolition of a large building.
- paulddraper 7y agoI suppose it's awesome for that capability to exist, though it wasn't even close to what should have happened here. Awesomely horrible.
- Dylan16807 7y agoMaking all your processes wait on a lock is multithreading 101. The horrible part is the specific way this lock is getting held, which is not useful. And there are simpler ways to prevent all access to a drive.