Roblox Interview Question

What would happen if you called this function re-entrantly?

Interview Answer

Anonymous

Feb 4, 2020

Hard to say w/o seeing the function… but reentrancy is only a factor of when a program us using multiple threads accessing globally accessible memory of some kind. The natural follow-up questions might be around what primitives one might use to mitigate reentrancy issues such as semaphores, critical sections, and mutexes. I’d also encourage the usage of the OS native functions such as the “interlock” family (InterlockedIncrement, etc) for such cases.