Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TipmyPip, AndrewAMD), 1,151 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
run multiple algo simultaneously #484188
09/19/21 07:28
09/19/21 07:28
Joined: Oct 2018
Posts: 96
7
7th_zorro Offline OP
Junior Member
7th_zorro  Offline OP
Junior Member
7

Joined: Oct 2018
Posts: 96
How to run multiple algos simultaneously?
I want to separate each algo use multi-threading.

For example,

Code
while(asset(loop(Assets)))
{
      algo("1");

      algo("2");

      algo("3");
}


to

Code
while(asset(loop(Assets)))
{
      for(int i = 0; i < 3; i++)
      {
             run_algo_thread(i);
      }
      wait_all_algo_thread_done();
}


Last edited by 7th_zorro; 09/19/21 07:35.
Re: run multiple algo simultaneously [Re: 7th_zorro] #484189
09/19/21 09:09
09/19/21 09:09
Joined: Apr 2008
Posts: 586
Austria
Petra Offline
Support
Petra  Offline
Support

Joined: Apr 2008
Posts: 586
Austria
For multiple algos, use loop. For multiple threads, use processes.

https://manual.zorro-project.com/engine.htm


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1