The same thing happened to me a while back, whenever I played a game or something my comp. would randomly restart, it would also restart just idling, but not as much. It turned out to be my power supply not giving enough power to my comp. I fixed it by buying another PSU. Try to download something that checks your voltage, if your getting less voltage than on the side of your PSU, it might be the same problem I had. Heh, it took me about a year to figure out it was my PSU, so much needless frustration.