Difference between revisions of "love.thread"
(fixed, thanks for noticing, dude) |
|||
Line 3: | Line 3: | ||
Threads are separate instances of the LOVE environment, 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. | Threads are separate instances of the LOVE environment, 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. | ||
− | {{notice|[[love.graphics]] and [[love.thread]] | + | {{notice|The modules [[love.graphics]] and [[love.event]] do not work with [[love.thread]]. Don't call their functions in a [[Thread]] other than main.}} |
== Types == | == Types == | ||
{{#ask: [[Category:Types]] [[parent::love.thread]] [[Concept:Current]] | {{#ask: [[Category:Types]] [[parent::love.thread]] [[Concept:Current]] |
Revision as of 19:13, 15 October 2011
Available since LÖVE 0.7.0 |
This module is not supported in earlier versions. |
Allows you to work with threads.
Threads are separate instances of the LOVE environment, 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.
The modules love.graphics and love.event do not work with love.thread. Don't call their functions in a Thread other than main. |
Contents
Types
Channel | An object which can be used to send and receive data between different threads. |
Thread | A Thread represents a thread. |
Functions
love.thread.getChannel | Creates or retrieves a named thread channel. |
love.thread.getThread | Look for a thread and get its object. |
love.thread.getThreads | Get all threads. |
love.thread.newChannel | Creates a new unnamed thread channel. |
love.thread.newThread | Creates a new Thread from a filename, string or FileData object containing Lua code. |
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