News for hackers. Stuff that matters.
Re:Mutexes are faster than Spinlocks by simias on Saturday January 04, 2020 @02:15PM (#21956745)
>The main use of spinlocks that i'm aware of is minimising latency in inter-processor communication.

The main use of spinlocks that I'm aware of is dealing with interrupt handlers in driver code. In this situation you generally can't go to sleep (sleeping with interrupts disabled is generally a good way of never waking up) so calling "mutex_lock" is simply out of the question. That's probably a niche use but that's literally the only situation I've ever used actual spin locks instead of mutexes, mainly for the reasons outlined by TFA.

Re:Mutexes are faster than Spinlocks by lmilcin on Saturday January 04, 2020 @09:23PM (#21959202)
I did some algorithmic/ high frequency trading and we were only spinning waiting for task and never, ever releasing to OS. But then the entire server was dedicated to one job and the job consisted of reacting to single stream of messages.

Most of the time I would say if lock performance impacts your application you are likely doing something wrong. There are many ways of solving typical synchronization problems without locks and if you need locks there are many ways to amortize costs.

Mutexes are not faster than spin locks the same way slower cars are not faster than fast cars. You might still crash in a fast car and be slower to the end of the race (to the supermarket) but that is just your failure to use the power you were given responsibly.

Re:Mutexes are faster than Spinlocks by vba on Saturday January 04, 2020 @02:36PM (#21956901)
TFA? Tried to google but unsuccessful
Re:Mutexes are faster than Spinlocks by NeedMoreTea on Saturday January 04, 2020 @02:45PM (#21956962)
I've seen lots of valid variants, including and probably not limited to:

The feature article ; the freaking article ; the friendly article ; the f$%^&*( article, c.f. RTFM.

Re:Mutexes are faster than Spinlocks by simias on Saturday January 04, 2020 @03:28PM (#21957251)
I personally go with "The Fine Article" in my mind when I write it, although obviously all these alternatives are possible. I first encountered this initialism on slashdot back when it was still relevant, although I don't know if it was coined there.

And yeah, I believe that it derives from "RTFA" (read the fucking article) which would be what you told people who obviously commented without reading the article.

Re:Mutexes are faster than Spinlocks by codezero on Saturday January 04, 2020 @04:03PM (#21957524)
Not sure it’s the origin, but it used to be RTFM (read the fucking manual).
Re:Mutexes are faster than Spinlocks by sjwright on Saturday January 04, 2020 @04:12PM (#21957598)
RTFM has been mostly superseded by LMGTFY.
Re:Mutexes are faster than Spinlocks by tingletech on Saturday January 04, 2020 @06:12PM (#21958308)
Also read "read the fine manual"
Re:Mutexes are faster than Spinlocks by gpderetta on Saturday January 04, 2020 @04:03PM (#21957523)
The original, as documented in the hacker dictionary, is of course RTFM (read the f...ine manual).
Re:Mutexes are faster than Spinlocks by axaxs on Saturday January 04, 2020 @02:43PM (#21956951)
The (Fuc|Frea)king Article. In a similar spirit to RTFM.
Re:Mutexes are faster than Spinlocks by hyperion2010 on Saturday January 04, 2020 @02:40PM (#21956931)
The aForementioned Article

the F is usually something else though ...

Re:Mutexes are faster than Spinlocks by saghm on Saturday January 04, 2020 @07:59PM (#21958848)
My OS professor in college told us "RTFM means read the manual; the 'f' is silent"
Re:Mutexes are faster than Spinlocks by taneq on Saturday January 04, 2020 @05:26PM (#21958039)
It’s the same F as in BFG. The gun, not the giant.
Re:Mutexes are faster than Spinlocks by loeg on Saturday January 04, 2020 @02:47PM (#21956980)
The Fine Article.
Re:Mutexes are faster than Spinlocks by wgjordan on Saturday January 04, 2020 @02:39PM (#21956914)
The (forementioned) article, I would imagine.
Re:Mutexes are faster than Spinlocks by thatsenough on Saturday January 04, 2020 @11:23PM (#21959618)
The Fabulous Article.
Re:Mutexes are faster than Spinlocks by ddebernardy on Saturday January 04, 2020 @02:44PM (#21956957)
TFA is Slashdot jargon for "The F'ing Article".
Re:Mutexes are faster than Spinlocks by mgalgs on Saturday January 04, 2020 @06:58PM (#21958559)
TFA on Slashdot... Takes me back to the good old days of 2007...
Re:Mutexes are faster than Spinlocks by rcxdude on Sunday January 05, 2020 @06:41AM (#21960834)
And this only makes sense in a multi-core system (where the spinlock is held on another core). In a single core system if you are trying to take a contended lock in an interrupt you are stuck and can only fail to take it and hope to handle that gracefully.
Re:Mutexes are faster than Spinlocks by trasz on Saturday January 04, 2020 @03:46PM (#21957372)
And even that is only true for systems that don’t use interrupt threads.