4 ms·
doesnt this inherently lower performance? Message-passing rather than shared data structures implies you need to pass around heavy copies of data. Are Lock-fr
by sandGorgon 17y ago
doesnt this inherently lower performance?
Message-passing rather than shared data structures implies you need to pass around heavy copies of data.
Are Lock-free data structures (supported probably by atomic hardware operations) the middle ground?
http://www.audiomulch.com/~rossb/code/lockfree/ http://www.audiomulch.com/~rossb/code/lockfree/
- silentbicycle 17y agoAlong with what ghpaco said, keep in mind that locking isn't free either.
- gchpaco 17y agoNot necessarily, even on a uniform memory access machine; perhaps you pass around a reference to an object that is located close to the data you want. On a non-uniform memory access machine (which is to say all of them these days when you take cache into account) message passing and the message passing formalism can actually save you time. Anyway, I don't a priori object to shared data structures, but it is important to remember that they are inherently dangerous and the amount of shared memory should be sharply limited to that which is actually necessary, rather than blindly making everything shared. Lock free data structures won't protect you from deadlocks or races necessarily; they mean you won't have to lock, but you can easily accidentally write a situation with two processes mutually waiting on each other.
- jacquesm 17y agoYou might even harness the power of paging in order to pass messages, with a copy-on-write exception to make the actual copying as lazy as you can. And if you're working on page boundaries copying can be done using DMA controllers.