I've created a game in VS2010 using VB .NET 4 in C#. The game creates a thread for each player, and runs LUA code that the players have created.
Each LUA code is blocking for the thread, and should only terminate when the thread is terminated (The LUA script should contain an infinite loop)
I want to limit the CPU usage as the computer is currently overheating after running with 100% CPU for a few hours.
How can I throttle the threads without having control within them? I was hoping to have a thread manager to force suspend/resume but those are becoming obsolete, and I don't want to be throwing exceptions because that will abort my LUA code that's executing.
Any ideas?
Thanks!