Get it to run on a single-thread first, and make sure the program is fully tested and debugged before even thinking about multiple threads.

Regards,

Paul McKenzie