#Signals in C++

19 messages · Page 1 of 1 (latest)

bronze sequoia
#

Are there any resources that are especially good if you wanna learn more about how signals work, etc? Especially in the context of game development. I'm not sure where they are best used etc, or if they always require macros like in Qt. I guess some sort of introduction would be good.

raw glacierBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

bronze sequoia
#

Are signals ever used to delay some function calls?

gritty knoll
gritty knoll
#

there are better ways to go about doing that

#

keep in mind in signal handlers you're extremely restricted in what functionality you can use

#

you can't do anything that might take a lock or call malloc, or interact with global state (without proper lock-free approaches)

gritty knoll
#

If you want to learn about godot's signal system you'd have to read their docs

bronze sequoia
#

There seem to be docs for how they are used, but not for how they are implemeneted.

gritty knoll
#

There are concurrency implications here, e.g. if you take a lock then emit a signal and a handler tries to take the same lock

#

Alternatively this could be implemented as part of an engine's event loop

bronze sequoia
#

Would there be one signal handler for every signal?

gritty knoll
#

Not necessarily

#

But I can't speak to godot in particular