Problem using multiple cores of a processor

ROBLOX seems to have a problem using multiple cores of a processor, and as shown by HWMonitor, and will use all threads when it is not selected, but as soon as you select the process it will start using only two cores, leading a lot of stuttering.

3 Likes

Those two videos look fine to me.

I don’t think all cores using 20% is because of Roblox. He should use something like Process Explorer to see how much of each core just robloxplayerbeta.exe is using. I notice nothing strange, though.

1 Like

Not a bug. Roblox wasn’t entirely designed for maximum available core utilization. We do some threading (e.g. rendering), but the worst offender - the scripts can’t be parallelized due to everything being accessible from anywhere.

5 Likes

Note: please ask non-personal questions in discussion threads, as they may be useful for other developers as well.

Concurrent execution of many Lua scripts on the same VM (besides VM performance overhead) is prone to a lot of concurrency-related errors, mostly due to the fact that e.g. two scripts trying to access the same object is a typical race condition. And having all objects accessible without restrictions from any script and context (including e.g. engine callbacks, async resumes, etc.) pretty much precludes any meaningful workarounds.

We did discuss a few alternatives like having “compute-only” contexts where scripts would run in parallel but wouldn’t be able to directly access the Datamodel or each others contexts, instead relying on specific communication channels. So far, we couldn’t come up with any meaningful interop model that didn’t involve serialization.

9 Likes

(post deleted by author)

1 Like

Roblox*

3 Likes

Indeed. Did he happen to have any questions?

Out of interest - can you send me a link to the first game?
It appears to be a stolen version of @Vaktus 's Recruitment Centre, and obviously that should be dealt with.

Nope, but he thanks you for your response