> > Because Insertion sorting is a serial algo. It haven't a isolated data > for different threads and haven't a mechanism to exchange data between > threads. So, threadA can write to data from threadB (and will do it). Perhaps I get you wrong, but there is no need for explicit mechanisms to isolate threads and exchange data with openmp (though explicit mechanisms can be more optimal than basic openmp in some cases, we have some in Yade, e.g. for summing forces). I'm not saying it is foolproof in all cases, but parallelizing a serial algo the non-intrusive way is exactly what OpenMP is supposed to do (that's what Anton did).
So, if insert() is safe, we are left with the only question: can threadA invalidate some data used by threadB during the sort? I couldn't spot such case, but I didn't spend so much time on it. Did you find one? B. _______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

