by Gaston Hillar
When you write concurrent code that has to make changes to shared variables, you might think that a mutual-exclusion lock is necessary to perform each update operation. In some cases, you can replace a mutual-exclusion lock with a more efficient atomic operation and you can boost both your application’s performance and scalability.
When you want to achieve the best performance for a parallelized algorithm, you can follow James Reinders’ 8 Rules for Parallel Programming for Multicore. Here I focus my attention on the importance of Rule #5 that suggests the usage of atomic operations instead of locks, whenever possible.



0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
You must log in to post a comment.