Wchris Posted July 27, 2010 Share Posted July 27, 2010 It's just theory If i set a LE callback and in this calback i use LE commands can i get an infinite loop ? i mean : LE command -> callback -> LE command inside callback -> same callback -> etc ... can this happen and would the program freeze or continue to render ? i fact i want to know if it's safe to use LE commands inside callbacks or if it should be avoided ? thank you PS: i'm writing a component for Tentity and want to handle the callback response as an event, so i have two choices, either call directly the event from callback, or send a message to the main thread to execute the callback code in the main loop separately to avoid conflicts. Of course, solution 1 is easyer to code. Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
Laurens Posted July 27, 2010 Share Posted July 27, 2010 I don't think the engine can tell the difference between a method and a callback function and would assume that for instance moving an entity in a UpdateMatrix callback would result in the callback getting called again. Therefore I would try to avoid it. Quote Link to comment Share on other sites More sharing options...
Wchris Posted July 27, 2010 Author Share Posted July 27, 2010 I don't think the engine can tell the difference between a method and a callback function and would assume that for instance moving an entity in a UpdateMatrix callback would result in the callback getting called again. Therefore I would try to avoid it. Yes i agree, thats why i hesitate. But it depends how the engine works. If the callbacks are only launched once in updateworld xor renderword and never from within other individual commands, then the engine is already serializing callbacks and i don't have to do it again. But of course if have no way to get the info. Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
Rick Posted July 27, 2010 Share Posted July 27, 2010 If you make a simple test of this you should be able to see what it's doing. Quote Link to comment Share on other sites More sharing options...
Wchris Posted July 27, 2010 Author Share Posted July 27, 2010 If you make a simple test of this you should be able to see what it's doing. you mean "Applog" before and after renderworld and updateworld and inside callbacks ? Hey, yes this could tell me what's going on. I'll try this. Thank you Rick, you're always helpfull You're always in advance ahead of me Quote Windows 7 home - 32 bits Intel Quad Q6600 - nVidia GTX 460 1GB - 2 GB RAM Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.