Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
4 registered members (TipmyPip, Quad, alibaba, izorro), 545 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Is Lite-C/A7 multithreading ? #254895
03/06/09 08:36
03/06/09 08:36
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
One of my Lite-C programs has two while loops running at the same time. Could you help explain this please ?

Thanks

Re: Is Lite-C/A7 multithreading ? [Re: dracula] #254896
03/06/09 08:43
03/06/09 08:43
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
I'd like to explain your own program to you. If only I knew it.

Re: Is Lite-C/A7 multithreading ? [Re: jcl] #254903
03/06/09 10:07
03/06/09 10:07
Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,209
İstanbul, Turkey
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.)


3333333333
Re: Is Lite-C/A7 multithreading ? [Re: Quad] #254905
03/06/09 10:26
03/06/09 10:26
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
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.

Re: Is Lite-C/A7 multithreading ? [Re: dracula] #254906
03/06/09 10:30
03/06/09 10:30
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
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

Re: Is Lite-C/A7 multithreading ? [Re: jcl] #254908
03/06/09 10:37
03/06/09 10:37
Joined: Apr 2008
Posts: 437
dracula Offline OP
Senior Member
dracula  Offline OP
Senior Member

Joined: Apr 2008
Posts: 437
Arhh ! that make sense, I never really understood wait(n), but now I do.

Thanks

Re: Is Lite-C/A7 multithreading ? [Re: dracula] #254912
03/06/09 11:10
03/06/09 11:10
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
@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"?

Last edited by Oxy; 03/06/09 11:16.
Re: Is Lite-C/A7 multithreading ? [Re: Oxy] #255303
03/09/09 13:10
03/09/09 13:10
Joined: Jul 2000
Posts: 27,967
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,967
Frankfurt
Three answers for the price of one? Here you go: No, no, and yes.

Details are explained in the manual, see the link above.

Re: Is Lite-C/A7 multithreading ? [Re: jcl] #255317
03/09/09 15:04
03/09/09 15:04
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
i guess lite-c uses some kind of getcontext/setcontext.


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1