Difference between revisions of "Script"

From GTAMods Wiki
Jump to navigation Jump to search
(Redirecting to Create a thread)
 
Line 1: Line 1:
#REDIRECT [[Create_a_thread]]
+
A '''thread''' descripes some kind of minimal process in computer science. Processes and threads are used to simulate parallel execution of programcode. But there is a difference between both: a process descipes the execution of a whole program. It contains an image of the programs binary executeable code in memory just as it is used for handling memory allocation by the operating system. However a thread is nothing in this way. It does just descripe a parallel execution of code inside a process, so one process can hold multiple threads.
 +
 
 +
The description above is just one very simple definition of a thread. GTA simplifies multithreading alot so everything the script needs to do is to start a thread and perhaps end it somehow. It does not need to handle variable synchronisation or communication between two threads. This is what the game does through internal routines.
 +
 
 +
== [[Opcode|OpCodes]] & [[Native function|Native functions]] ==
 +
{{Incomplete}}
 +
 
 +
* [[004E]] – Ends the current thread
 +
* [[004F]] – Creates a parameterized thread
 +
* [[00D7]] – Creates an unparameterized thread
 +
* [[03A4]] – Gives a thread a name
 +
* [[0459]] – Ends a named thread
 +
* [[004E]] – Ends the current thread
 +
 
 +
 
 +
''[[CLEO]] OpCodes''
 +
* [[0A92]] – Creates a ''CLEO'' thread
 +
* [[0A93]] – Ends a ''CLEO'' thread
 +
* [[0A95]] – Enables thread saving for a ''CLEO'' thread
 +
* [[0A9F]] – Returns the current threads pointer
 +
* [[0AAA]] – Returns the pointer to a named thread
 +
* [[0AVA]] – Ends a named ''CLEO'' thread
 +
 
 +
== Links ==
 +
* {{Icon|SA}} [[Create a thread]]
 +
 
 +
== Further Information ==
 +
* [[Wikipedia:Process_(computing)|Process]]
 +
* [[Wikipedia:Thread_(computer_science)|Thread]]
 +
 
 +
{{N|4|SA}}
 +
[[Category:Mission_Scripting]]

Revision as of 13:46, 12 September 2009

A thread descripes some kind of minimal process in computer science. Processes and threads are used to simulate parallel execution of programcode. But there is a difference between both: a process descipes the execution of a whole program. It contains an image of the programs binary executeable code in memory just as it is used for handling memory allocation by the operating system. However a thread is nothing in this way. It does just descripe a parallel execution of code inside a process, so one process can hold multiple threads.

The description above is just one very simple definition of a thread. GTA simplifies multithreading alot so everything the script needs to do is to start a thread and perhaps end it somehow. It does not need to handle variable synchronisation or communication between two threads. This is what the game does through internal routines.

OpCodes & Native functions

This section is incomplete. You can help by fixing and expanding it.

  • 004E – Ends the current thread
  • 004F – Creates a parameterized thread
  • 00D7 – Creates an unparameterized thread
  • 03A4 – Gives a thread a name
  • 0459 – Ends a named thread
  • 004E – Ends the current thread


CLEO OpCodes

  • 0A92 – Creates a CLEO thread
  • 0A93 – Ends a CLEO thread
  • 0A95 – Enables thread saving for a CLEO thread
  • 0A9F – Returns the current threads pointer
  • 0AAA – Returns the pointer to a named thread
  • 0AVA – Ends a named CLEO thread

Links

Further Information