Each .gsc file runs simultaneously and starts with their init() function. It usually can be found fairly at the top.
Let's discuss the following example:
Then the second one which is a concurrent call to doCommands() due to the thread keyword. Init() and doCommands() now run simultaneously and init() carries on without waiting for doCommands() to finish.
Init() jumps into goHere() and returns only when that function completed.
Let's discuss the following example:
- Code:
init()
{
self.variable = 100;
self thread doCommands();
self goHere();
}
doCommands()
{
}
goHere()
{
}
Then the second one which is a concurrent call to doCommands() due to the thread keyword. Init() and doCommands() now run simultaneously and init() carries on without waiting for doCommands() to finish.
Init() jumps into goHere() and returns only when that function completed.