Gamestudio Links
Zorro Links
Newest Posts
How to select between IB accounts by script?
by Jack_Zodiac. 06/12/26 23:17
Zorro tutorial ideas?
by pr0logic. 06/12/26 13:36
Max Number of Strategies in /Strategy folder
by Martin_HH. 06/12/26 08:50
Stooq now requires an API key
by AndrewAMD. 06/11/26 17:55
Z9 getting Error 058
by k_ivan. 06/10/26 14:38
ZorroGPT
by TipmyPip. 06/10/26 13:07
Z12 live performance
by alx. 06/09/26 20:42
Lapsa's very own thread
by Lapsa. 06/08/26 22:41
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (Quad, TipmyPip, pr0logic), 2,041 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Student_64151, Koti, curry, DeepxKalsi, Samed
19219 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
calling functions at the same time #414642
01/06/13 04:53
01/06/13 04:53
Joined: Aug 2011
Posts: 58
Colombia/Bogotá
W
wdakfenixx Offline OP
Junior Member
wdakfenixx  Offline OP
Junior Member
W

Joined: Aug 2011
Posts: 58
Colombia/Bogotá
So, in the program I´m writting I have to make a really long for instruction, in this particular case to 2^15 (32768), it however freezes the screen for a few seconds, so it goes something like this:
Code:
function A(var start,var end)
{
var i;
 for(i=start;i<end;i++)
  {
   //actions here
  }
}

function main()
{
  A(0,32768);
}


Is there anyway to call several instances of the A function at the same time, so it finishes faster:
Code:
function A(var start,var end)
{
var i;
 for(i=start;i<end;i++)
  {
   //actions here
  }
}

function main()
{
  A(0,8192);
  A(8192,16384);
  A(16384,24576);
  A(24576,32768);
}


If write it that way it will call one function after another, and what I want is to call them at the same time, any ideas how to?, or is there a better way?, thanks in advance.


CAUTION :The content above could blow your mind
Re: calling functions at the same time [Re: wdakfenixx] #414688
01/06/13 16:30
01/06/13 16:30
Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
Quad Online
Senior Expert
Quad  Online
Senior Expert

Joined: Oct 2007
Posts: 5,211
İstanbul, Turkey
If these functions are for calculation purposes only and does not use engine functions (_create functions, or functions that return an engine object), you can call them on separate threads. Search threading in forums.


3333333333

Gamestudio download | 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