Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Is there any change to cause damage to a processor by make a mistake while using coroutine?

Asked by 7 years ago

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?

1
No lol. RubenKan 3615 — 7y
0
I need a more technical answer than that, I have used the CMD of computers and assembler language, I know beforehand that a mistake can goes very expensive LordSalchipapas 96 — 7y
0
Not in roblox. RubenKan 3615 — 7y

1 answer

Log in to vote
1
Answered by 7 years ago

The short answer is no.

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.

If the program hangs, close it using task manager or if your entire computer has frozen you can simply reboot it and it will be fine.

Ad

Answer this question