lppcom / opencl-book-samples

Automatically exported from code.google.com/p/opencl-book-samples
0 stars 0 forks source link

Chapter 16: Dijkstra's example has race condition on updateCostArray #68

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Dijkstra's algorithm as presented is fundamentally broken because it suffers 
from a race condition when writing to updateCostArray from multiple threads.  
Because there is no synchronization, when two vertices want to update the node, 
they can both get past the if statement but the cost array can then be updated 
by the wrong vertex.

Original issue reported on code.google.com by edel...@gmail.com on 19 Feb 2012 at 10:54