lazy smp using ms vs2015 c++11 std::async

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

jdart
Posts: 4367
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: lazy smp using ms vs2015 c++11 std::async

Post by jdart »

It is possible that some programs might benefit from it.

However, two hyperthread cores in the same execution unit share everything in the memory system. So it is possible for HT to increase memory contention, especially when RAM is limited and is being heavily utilized. (There is a pretty recent paper that basically says this: https://www.nas.nasa.gov/assets/pdf/pap ... g_2011.pdf).

--Jon
edwardyu
Posts: 34
Joined: Mon Nov 17, 2008 6:58 am

Re: lazy smp using ms vs2015 c++11 std::async

Post by edwardyu »

Yes, Eychessu is my Xiangqi engine. I have been away from computer chess for sometime and pick it now, Before heard of lazy smp, I have tried using MS VC++ PPL to implement smp with splitting at the PV and non-PV nodes, but the result was worse than single thread (due to the vast overhead of concurrency) !!!

Instead of setting up threadpool, I like the simplicity of std::async. However, I found that even I use 2 real-core threads (no HT) to run lazy smp, the result is marginally break-even to offset the smp overhead.