Posted 16 September 2016 - 06:50 PM
Hello there,
So, I've been reading the coroutine tutorial, and I think I get it.
The problem is that, in the tutorials, the maximum I get to is to switch between two functions. My problem comes
when it gets to making it a library, not an executing script. I need to start a thread, run them all in a while true loop,
as all programs will run in there, but I don't really know how to make it. Also killing the processes in some kind
of SIGKILL and SIGTERM. Also, my programs will need IDs, parents and childs, and I tried to use CCDelta's Thread.lua or trying to look at cubix's proc_manager but I don't get myself clear with all of this. So, I have various questions on this topic:
1) How events internally work, if they use yields and resumes?
2) How do I implement multithreading as a simple and clean library with the things mentioned above?
3) How can I make it so all processes must run on that and when there are no processes, shut down?
Thanks in advance
~ Dael
So, I've been reading the coroutine tutorial, and I think I get it.
The problem is that, in the tutorials, the maximum I get to is to switch between two functions. My problem comes
when it gets to making it a library, not an executing script. I need to start a thread, run them all in a while true loop,
as all programs will run in there, but I don't really know how to make it. Also killing the processes in some kind
of SIGKILL and SIGTERM. Also, my programs will need IDs, parents and childs, and I tried to use CCDelta's Thread.lua or trying to look at cubix's proc_manager but I don't get myself clear with all of this. So, I have various questions on this topic:
1) How events internally work, if they use yields and resumes?
2) How do I implement multithreading as a simple and clean library with the things mentioned above?
3) How can I make it so all processes must run on that and when there are no processes, shut down?
Thanks in advance
~ Dael