What does "Unsafe" mean on the Developer Hub?

Hey! How is it going?

About 15 minutes ago, I was looking at CloneTroopers Roblox API History, and went to the Developer Hub on one of the new functions, and I saw this:


What does it actually mean?

If you have an answer, please let me know. Thanks! WE

5 Likes

Roblox is adding some advanced features to Luau. They’re adding multithreading. “What is multithreading” is a good term to google if you want to learn more.

Basically though, a computer has several processors in it that can run code at the same time.

It used to be that roblox only used one processor, and only ran one line of code at any given time. Even with things like coroutines, the processor just jumps back and forth between scripts. But it never can do two things at once.

Well, now, Roblox is letting your computer literally run two or more lines of code at once.

If you aren’t smart about it, the two processors can step on each other’s toes and cause hard-to-find bugs.

An “Unsafe” property means that if you’re using this fun new feature, you’d better be really careful about reading this property, because Roblox makes no guarantees that some other thread isn’t messing with it at the same time you’re trying to read it.

This leads to bugs that really suck, because the program might look likes it’s working, until the stars align and two threads conspire to mess with it.

32 Likes