Difference between revisions of "love.thread"
(Added info about love.thread only having love.thread loaded at start.) |
(Applying listings to included added and removed fields.) |
||
Line 9: | Line 9: | ||
{{#ask: [[Category:Types]] [[parent::love.thread]] [[Concept:Current]] | {{#ask: [[Category:Types]] [[parent::love.thread]] [[Concept:Current]] | ||
| headers=hide | | headers=hide | ||
+ | | format=template | ||
+ | | template=ListingFields | ||
+ | | introtemplate=ListingIntro | ||
+ | | outrotemplate=ListingOutro | ||
| ?Description | | ?Description | ||
+ | | ?PrettySince | ||
+ | | ?PrettyRemoved | ||
}} | }} | ||
== Functions == | == Functions == | ||
{{#ask: [[Category:Functions]] [[parent::love.thread]] [[Concept:Current]] | {{#ask: [[Category:Functions]] [[parent::love.thread]] [[Concept:Current]] | ||
| headers=hide | | headers=hide | ||
+ | | format=template | ||
+ | | template=ListingFields | ||
+ | | introtemplate=ListingIntro | ||
+ | | outrotemplate=ListingOutro | ||
| ?Description | | ?Description | ||
+ | | ?PrettySince | ||
+ | | ?PrettyRemoved | ||
}} | }} | ||
[[Category:Modules]] | [[Category:Modules]] |
Revision as of 23:09, 29 March 2013
Available since LÖVE 0.7.0 |
This module is not supported in earlier versions. |
Allows you to work with threads.
Threads are separate Lua environments, running in parallel to the main code. As their code runs separately, they can be used to compute complex operations without adversely affecting the frame rate of the main thread. However, as they are separate environments, they cannot access the variables and functions of the main thread, and communication between threads is limited.
When a Thread is started, it only loads the love.thread module. Every other module has to be loaded with require.
The love.graphics module has several restrictions and therefore should only be used in the main thread. |
Contents
Types
Channel | An object which can be used to send and receive data between different threads. | 0.9.0 | |
Thread | A Thread represents a thread. | 0.7.0 |
Functions
love.thread.getChannel | Creates or retrieves a named thread channel. | 0.9.0 | |
love.thread.getThread | Look for a thread and get its object. | 0.7.0 | 0.9.0 |
love.thread.getThreads | Get all threads. | 0.7.0 | 0.9.0 |
love.thread.newChannel | Creates a new unnamed thread channel. | 0.9.0 | |
love.thread.newThread | Creates a new Thread from a filename, string or FileData object containing Lua code. | 0.7.0 |
See Also
Other Languages
Dansk –
Deutsch –
English –
Español –
Français –
Indonesia –
Italiano –
Lietuviškai –
Magyar –
Nederlands –
Polski –
Português –
Română –
Slovenský –
Suomi –
Svenska –
Türkçe –
Česky –
Ελληνικά –
Български –
Русский –
Српски –
Українська –
עברית –
ไทย –
日本語 –
正體中文 –
简体中文 –
Tiếng Việt –
한국어
More info