Misc Plugin dev questions[Was: Finding internal objects (Inventory Items, etc.)]

Started by Denzil Quixode, Wed 09/09/2009 15:08:39

Previous topic - Next topic

Denzil Quixode

Is repeatedly_execute_always() guaranteed to either


  • ...get run before/after repeatedly_execute() (or on_key_press() etc.) if that function does not make any blocking calls, or
  • ...get run while one of those functions is waiting for a blocking call to return (and the blocking call will not return while repeatedly_execute_always() is still running)?
In other words, am I right in thinking that even though it is run in a different execution thread, calls to repeatedly_execute_always() are not run at completely unpredictable times that could potentially overlap with any part of the "other" code?

The reason that I ask is I want to be able to call blocking AGS functions from some of my plugin functions, and I'd also like to be reasonably confident that other plugin functions will work safely if called from repeatedly_execute_always(). So, I could potentially have one plugin function waiting for a blocking call to finish, at the same time that another plugin func gets called. If all I need to do is be careful that my plugin functions are "re-entrant" at the point that they make any blocking calls, I think I'm already all right, but if I actually need to make them all fully re-entrant that makes things trickier...

Pumaman

You can't make any blocking calls while rep_exec_always is running. This is to avoid the rep_exec_always thread getting blocked.

rep_exec_always will always finish executing before any blocked rep_Exec call will resume.

Does that answer your question?


SMF spam blocked by CleanTalk