I need to test some functions with coroutine.yield(), coroutine.resume(thread), etc, I know when we stop a thread we acctualy stop something in the processor, and know there is the change that the processor never returns, or that no function reactivates the processor, so my question is, is there a chance acctualy cause damage to the hardware by making a mistake in the code?
The long answer, is also no, BUT the fact of the matter is simple:
Roblox Basically only uses two threads, one for rendering and one to run all game code and call physics which might choose to use more threads (According to zeuxcg).
In a nutshell, the only way you are likely to crash Roblox is if you run something like
while (true) do print(1); end
Which prevents the task pipeline from continuing. The reason why Roblox as a program crashes when the game freezes is probably because the game's main thread also contains the code to run the program window itself.
Now what does this have to do with hardware?
When you run an infinite or very very long loop, it can simply hog an entire processor core or thread. That means that no other code can be ran on that core while the loop is executing. All it will do is generate a little more heat.
This will NOT damage your processor because they are designed to handle this sort of stuff. The only way you could possibly get permanent damage is if it overheated and wasn't being properly cooled, though that is unlikely unless you overclock your processor.