Threads for long computations?

I want to just play around with AI for a bit now. I want to see if I can make a relatively decent chess AI. It will probably not work, but whatever.

In any case, when I make a game, I have it work through a series of “ticks,” that is every 60th of a second the game “ticks,” runs through all of it’s code, then will tick again later.

Usually my computations are very small, so it runs just fine. However, what if I want to do 5 seconds worth of computations before the computer moves? I would want the game to continue “ticking” 60 times a second, except be running it’s computations in the background.

Now, I know about threads and whatnot, but I don’t understand how to implement them into my code in this sort of situation. Could anybody point me in a direction, or give me some tips for going in such a direction?

Thanks