Posted By: dracula
Is Lite-C/A7 multithreading ? - 03/06/09 08:36
One of my Lite-C programs has two while loops running at the same time. Could you help explain this please ?
Thanks
Posted By: jcl
Re: Is Lite-C/A7 multithreading ? - 03/06/09 08:43
I'd like to explain your own program to you. If only I knew it.
Posted By: Quad
Re: Is Lite-C/A7 multithreading ? - 03/06/09 10:07
you mean there is a while in each action? and you see their results every frame?
it's basically that all entites actions run one by one, but they are all run once at every frame, this a very very fast process that you cant feel the lag between executions of whiles. they run every frame, one after the other, not same time. At any given time only one action runs.
if you mean that you have 2 whiles in main, this is most likely it runs the first one then the other one, or it never runs 2nd if you are using infinite loops.
---
but if you want threads, you can do it. (Search forum.)
Posted By: dracula
Re: Is Lite-C/A7 multithreading ? - 03/06/09 10:26
I have a while loop in main() ie the "game loop". I also have a function running which uses a while loop.
They are both running (or appearing to run at the same time.
Posted By: jcl
Re: Is Lite-C/A7 multithreading ? - 03/06/09 10:30
They are not running at the same time. If your loops contain a wait(1), they are paused and started again in the next frame at the same position.
http://manual.3dgamestudio.net/acrt-wait.htm
Posted By: dracula
Re: Is Lite-C/A7 multithreading ? - 03/06/09 10:37
Arhh ! that make sense, I never really understood wait(n), but now I do.
Thanks
Posted By: Oxy
Re: Is Lite-C/A7 multithreading ? - 03/06/09 11:10
@jcl:
How does the wait work internally?
Is there a seperate thread created for each function, wich pauses
when getting a "stop+wait" event?
Or is the function (by the compiler) seperated into "slices" (between the wait commands) wich get processed
in a certain order in a single Thread.
And is there a method to read out the number of currently active/paused functions
in the "scheduler list"?
Posted By: jcl
Re: Is Lite-C/A7 multithreading ? - 03/09/09 13:10
Three answers for the price of one? Here you go: No, no, and yes.
Details are explained in the manual, see the link above.
Posted By: Joey
Re: Is Lite-C/A7 multithreading ? - 03/09/09 15:04
i guess lite-c uses some kind of getcontext/setcontext.