News for hackers. Stuff that matters.
Re:We switched to Node.js: the good and the not so good by StavrosK on Monday January 14, 2013 @09:00AM (#5054641)
There are no reasons to use busy waiting anywhere. This isn't what we're discussing, though.
Re:We switched to Node.js: the good and the not so good by scott_s on Monday January 14, 2013 @10:00AM (#5054848)
Well, yes, there is. When implementing locks, it depends on how likely and how long contention is. If the expected cost of busy waiting is less than the expected cost of interacting with a heavier-weight scheduling system (which may mean crossing the kernel boundary), then busy waiting is better. This is, of course, for lower level codes. For example, spin locks (so-called because they spin - or, busy wait - on a status variable) are frequently used in kernel code, and I have used them in a memory allocator.
Re:We switched to Node.js: the good and the not so good by StavrosK on Monday January 14, 2013 @11:21AM (#5055229)
Sure, in that case, it makes sense. As you say, though, it's for lower-level codes.