#Signals in C++
19 messages · Page 1 of 1 (latest)
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.
Are signals ever used to delay some function calls?
You pretty much never need signals unless you're doing systems programming stuff
In theory you could use a timer_create/SIGALRM sigaction but that's really limited and hacky
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)
But godot has signals.
I'm guessing they're talking about a different kind of signal
If you want to learn about godot's signal system you'd have to read their docs
There are docs for how they are used but right now if I have to look around in the godot source code, I'd probably need to schedule that for another time.
There seem to be docs for how they are used, but not for how they are implemeneted.
It's likely jsut a matter of signal emit calling all registered signal handlers
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
Would there be one signal handler for every signal?