ok I looked up reentrant and well the key function uses _getch() and cerr, can this be the reason? and plus I have the main also running the key function, as for synchronisation I'm using non since each thread has a completely independent sets of data. may I add that the key function is templated but all threads uses the same template arguments.

thank you all for your help