I have an update on the issue I previously posted about.
The problem occurs when you have 40 different actors, and you send a message very fast to each actor and the script waits for the actor’s response using GetAttributeChangedSignal("ActorFinished"):Wait().
or any sort of waiting for a response except: repeat task.wait() untill actor:GetAttribute("ActorFinished")
because task.wait() yield the thread till the next heartbeat
for _, i in script.Parent.Folder:GetChildren() do
i:SendMessage("Hello")
i:GetAttributeChangedSignal("Hi"):Wait()
print("actor")
end
local actor = script.Parent
actor:BindToMessage("Hello", function()
actor:SetAttribute("Hi", true)
end)
this error shows up
My question now is: Is this a limitations of parallel Luau, a bug, or am I just doing something wrong?
Can you double check if you are changing the attribute’s value right after waiting for GetAttributeChangedSignal multiple times?
Also maybe you could try to make Workspace’s SignalBehavior property to “Deferred” to produce a bug rather than killing the connection completely after it gets called again and again. So you could just maybe find out where the issue is?
Maximum re-entrancy depth exceeded is a signal connection invoking itself over and over AFAIK.
Have you tested it without using actors? This could very well happen without actors
Either way, sending this many messages between actors is not recommended as sending messages between lua vms is slow, and it currently isn’t running in parallel (though I assume you will change that once you got your system working). It is also not recommended to go between the serial phase and the parallel phase multiple times per frame
I’ve made this module for running computational tasks in parallel, which you might find interesting
yea Sending messages between actors very quickly causes the error, but I don’t understand why setting the SignalBehavior property to ‘Immediate’ makes it work fine.
Btw, I looked up your module, and it seems very useful. I’ll be using it.
Okay, I’ve tested something and found that the problem isn’t from the actors.
Here is what i did:
for i = 1, 50 do
local event = Instance.new("BindableEvent")
event.Event:Connect(function()
print("Hi")
event:SetAttribute("EventFinished", true)
end)
event:Fire()
event:GetAttributeChangedSignal("EventFinished"):Wait()
print("Finished")
end