I have a few programs that I am converting to be threaded. At present I have a couple of programs, computer chess engines, that are threaded and work fine with Microsoft's C++ compilers.
When the SMP.H #define's detect _WIN32 || _WIN64 it calls up process.h functions but on other platforms it need to use a bit map in ASM to manage the threads properly.
Other considerations include inter-process communications etc.
If threads dont need to speak to each other then the situation is simple, if not then some form of signalling is needed and the program becomes more complex.
One program I use computes end game positions for chess, using retrograde analysis, and can bring a Cray XT3 to it knees as readily as any PC.
I have tested it on Dual Core and Dual Processor systems and it works fine. Its very complex with a lot of optimizations tossed in already. I did have to tweak it a bit to get it working faster and fixing the problems to better use SSE on a 32-bit platform and long registers on an x64 platform.
Recursion is another headache for polythreaded applications. Fixing errors in a recursize program are tricky too, because the terminating conditions may not be so easy to establish in larger procedures.

Poly-Threaded C++ Applications
Henrique Mello Quintino
Good to see, I do various projects in C++ where there are a few programs I have updated to be more up todate.
For eg.
#include "stdio.h" is replaced with <iostreams> && <fstreams>
#include "stdlib.h> is replaced with <cstdlib>
and after all the changes, the performance went up dramatically with recent compilers from MS under Windows x64. At the same time, compiling for x86 with SSE/SSE2 is also enhanced.
I have a migation module I wrote to include with C++ programs to help me detect problems optimizing code to run faster etc.
I do a lot of work to optimize programs, so that inline works effectively while keeping the code size small enough to fit the cache.
Crystal-Jacd
Lars Koewing
Chess is not the easiest project to do. There are several components required and they are all hard to do. Chess programs are found in high level academic settings, and require many many advanced algorithms.
There is a lot of open source chess chess to look at, use a search engine. They are of varying programming techniques, and I have seen a dozen so there are lot of examples.
A complete chess program is many tens of thousands of lines of C++ code, so be warned its not for beginners.
Larry Baker
Ehrick
Well let me point out some things... as I think they are not clear to all of us...
The reason that forums do exists is that users can Interact with others and provide either assistance or solve problems well anything that you want to find out forums is the place to do so... By discouraging you and by saying this is hard this is not for you etc... We may be killing you programming instinct and stuff... Well I have questions too as we do all... No one knows everything and never will... Thus we ask... So when you have questions or even want help don't hesitate to ask... Some1 will pop up and say what you need ;)
Best regards,
a.ka. Andr3w
joyhrs
Well indeed chess can be tricky but tbh I haven't even thought of writting a program that does that... Well anyway... it's not my stuff of interest let's say. Since you are new you are encouraged to learn by making attempts... if you want to try it go ahead and do so it's the only way to learn smth... I hope you have a pleasan time programming you chess....
Best luck!
a.ka. Andr3w
seraph
Considering my thought is to make my code work on every processor I decided early on, that certain approaches are likely to bite me later one.
To that end, i was an early adopter of the new C++ headers, and over time I have seen better performance just using the new headers. Not sure why, but the system runs better with the header change so I ran with it.
The real beef comes from a careful arangement of the methods, so that the main loops can call inline funcations and improve performance as well.
Finally there is algorithm choice, I like O(n) sorts, and O(1) searches. My school could not see anything past O(n^2) they fools that they are. Small wonder why software is so slow compelling Intel and AMD to constantly try to make the processors faster.
My software is so fast, its able to run fine on anything, but the chess program is working on calculating every position in chess might take a while considering there are 10^120 positions to be pondered. I am only a small contributor to chess programs, many have worked on it before me going back to the 1950s and earlier.
Railmonkey
Thanks for your encouraging and positive reply. I am not discouraged by the earlier comments (only I do not think them helpful and agree with you that I can try this chess programming project, as I am certainly not competing with top sophisticated software projects and will be satisfied with a basic program!).
I am pleased to know there are more helpful programmers around like you that I can turn to as and when I need advice.Thanks again and best wishes to you and for your programming work.
Samsagaz
I was commenting on my experiences working in C++ in the new x64 architecture with muli-core processors etc.
The program works well, and is fast as its going to get without requiring other programs to be changed as well.
My best skill is with C++ but I also use ASP.NET stuff as well, but I still use C++ over C# because this way the code can be run on other architectures.
You doing any poly threaded work yourself
LisaD
Abhijeet
good job mate on you succeess to make a chess engine working and stuff. But I don't get what's the question that you want to be answered. Or mainly the reason for the post... Sorry if I am missing smth here... But i would like a tip on that....
ty
Iulian
Hi,
I am new to programming and am interested in programming and creating a simple computer chess progam, that can play against an engine and can view and edit pgn and also have a pgn database.
I have recently looked at the web for help with this and there is a lot on computer chess out there! I know this will be quite a task for me to do as I am only just learning as I go, but I like a challenge and there seems to be some good resources available. I already know of C# Sharpchess program development which maybe a good starting point for me. I am also considering this development in Java form (cf Chesspresso opensource material which I have not yet investigated).
Can you offer any advice and reference/resource links, to me please Thanks
woodced
Phil Wasserman