0 votes

I want to know the specific mechanics of emit_signal()

Are signal handlers invoked immediately and in the threading context of the emitter (if any multi-threading is involved) or is the signal a event like message posted to message queue? (I think it does not)

Or something else?

The two distinct bits of information I am after are, when do the handlers execute and in what context, and are message queues involved or not

Godot version 3.2
in Engine by (22 points)

To my understanding, when you emit a signal, the connected functions will be executed in a similar manner to what would happen if you'd just directly call the function, in a single-threaded immediate basis.
But all my information comes from placing a breakpoint before the emit_signal() line and stepping through the code execution in the debugger, so take it with the appropriately sized grain of salt.

This level of knowledge, you might be best served by just looking at Godot's source code. Open source ftw

Yeh I could but I'd like to capture it outside of an individual groveling through the source. How signals are handled comes under design considerations, such the cpu cost of processing signals at certain points in godot's processing cycle.

Thank you , I expect this is the case.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.