Team Spartan Cookies & Milk Forums
Questions... - Printable Version

+- Team Spartan Cookies & Milk Forums (https://teamscm.co.uk)
+-- Forum: Garry's Mod (https://teamscm.co.uk/forum-4.html)
+--- Forum: Starfall (https://teamscm.co.uk/forum-7.html)
+--- Thread: Questions... (/thread-1754.html)



Questions... - Yuri6037 - 29-05-2016

Hey all,
I noticed about the channels now async : are all methods thread safe ? Is the callback still called on main thread ?
About the timers limit, will the coroutine library get the same issue ?


RE: Questions... - Person8880 - 29-05-2016

Asynchronous does not mean concurrent threads are involved. It just means that your message is sent some time in the future after you tell it to be sent, rather than immediately. This ensures that your chip is not held up by the listeners of others.

The timer limit is purely because all timers are going through the engine's timer system, so having too many will hold up others. Coroutines are standard Lua objects, there's nothing about them that requires a specific limit.


RE: Questions... - Yuri6037 - 29-05-2016

OK I see now, so I'm going to replace 90% of LanAI tasks by coroutines using the wait method. All output will be added to a table that will be parsed directly by chat listener hud (through global tables)...

This should allow me to put another 10 more tasks running at the same time if needed (obviously LanAI uses only 5 tasks so...)


RE: Questions... - LocInt - 29-05-2016

I am using a queue for messages and timers.