Parallel search: System-level programmin details

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

AlvaroBegue
Posts: 931
Joined: Tue Mar 09, 2010 3:46 pm
Location: New York
Full name: Álvaro Begué (RuyDos)

Re: Parallel search: System-level programmin details

Post by AlvaroBegue »

After gathering some information here (thanks for the responses) and reading about C++11 threads, my current plan is to use a std::condition_variable where all idle threads will wait for work. After I make a split point available I will call notify_all(). That should make every idle thread go and try to grab a move to work on.

Of course, there are many details to iron out, but I think this scheme should be workable. Calling notify_all on a std::condition_variable that has no workers on it is pretty fast (22 ns according to a simple synthetic test).

If you think this is a terrible idea and have a much better suggestion, it would be appreciated. If not, I'll report back after I get something working.