Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (TipmyPip, AndrewAMD, dBc, clonman), 18,621 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 Offline
Senior Expert
Quad  Offline
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