> >> Overall I recommend reading http://bisqwit.iki.fi/story/howto/openmp/ >> which is a rather good tutorial. > > Quickly glanced over it and it looks interesting, will read it later. >
yes that's the best balance between a tutorial/reference material/documenting quirks I could find... >> Once a suitable area for OpenMP is identified, the tricky part is to >> understand clearly what happens in the code that we are handling. The >> reason it took me so long to integrate OpenMP was that I hadn't >> realized that reading an image meant writing it in the cache, and thus >> the image cache had to be protected. Once that was figured out, adding >> criticall section around the variable access was easy. Same thing with >> SDL surfaces that need to be protected because they are ref-counted. > > Since threading in general is tricky, I wonder how easy will it be to > accidently break OMP due to seemingly unrelated changes? that's a good question, I'm not too worried for the animation part because it is well contained... I think OMP will only be used on a few well-contained area and not everywhere throughout the code, which should help quite a bit. > Would it make > sense to document what code is depending on OMP and which preconditions > it relies upon? > I'm not really sure what to document and how to make sure people read that documentation... Usually it boils down to protecting a variable which means adding a #pragma omp criticall(varname) around all calls to that variable. So i'm not too afraid of people missing that... > -- > Regards, > Mark de Wever aka Mordante/SkeletonCrew > > _______________________________________________ > Wesnoth-dev mailing list > Wesnoth-dev@gna.org > https://mail.gna.org/listinfo/wesnoth-dev > _______________________________________________ Wesnoth-dev mailing list Wesnoth-dev@gna.org https://mail.gna.org/listinfo/wesnoth-dev