- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Due to locking issues the post becomes "FirFirst!st!"
Admin
I regret clicking on a specific word in the article.
Admin
Time for a WTF or two about devs who don't understand floating point, and other things that should have made them flunk CS201.
Admin
One of my coworkers insisted something like this would work for locking threads. Thankfully, he actually listened when we explained to him why it wouldn't.
Admin
sigh
Admin
Threads?
Admin
Well, so long as there's a railing, lamppost, or similar inside the yellow loop, that might actually work to stop someone making off with the front wheel and the handlebars. It doesn't stop someone stealing the saddle and/or the rear wheel and/or the frame, but at least you'll have the handlebars and the front wheel. (Depending on how hard it is to remove the handlebars from the top of the steering column without cutting anything, you might even get to keep the frame.)
The locking "solution" in the article is even less good than that.
Admin
Sounds to me like the "Lock Ness Monster".
Sorry, I couldn't resist. You can groan now.
Admin
I can never remember how to do this. i always have to go to that stack overflow answer.
threading is hard
Admin
Once they learn how to make monitors work, the next step is always trying to run hundreds of threads doing IO on a single disk, or trying to run 1000 threads that all stack up on a single monitor. :-/
Admin
I have seen similar code, It was introduced to fix some bug. Interestingly it was some sort of stack corruption... And it... did the job!? After a long investigation we found that the useless lock was shifting the values in the stack only to make the bug corrupt some other memory. The bug went away...
Creating a stack in which 90% of values are only there to be corrupted seems like legit solution to problems. I call the pattern: "meat shield".
Admin
nice!