Difference between revisions of "love.thread"

(Returned back missing functions)
(fixed, thanks for noticing, dude)
Line 5: Line 5:
 
{{notice|[[love.graphics]] and [[love.thread]] don't play nice together. Don't call love.graphics functions from a [[Thread]].}}
 
{{notice|[[love.graphics]] and [[love.thread]] don't play nice together. Don't call love.graphics functions from a [[Thread]].}}
 
== Types ==
 
== Types ==
{{#ask: [[Category:Types]] [[parent::love.thread]]  
+
{{#ask: [[Category:Types]] [[parent::love.thread]] [[Concept:Current]]
 
| headers=hide
 
| headers=hide
 
| ?Description
 
| ?Description
 
}}
 
}}
 
== Functions ==
 
== Functions ==
{{#ask: [[Category:Functions]] [[parent::love.thread]]
+
{{#ask: [[Category:Functions]] [[parent::love.thread]] [[Concept:Current]]
 
| headers=hide
 
| headers=hide
 
| ?Description
 
| ?Description

Revision as of 22:15, 1 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.

O.png love.graphics and love.thread don't play nice together. Don't call love.graphics functions from a Thread.  


Types

ChannelAn object which can be used to send and receive data between different threads.
ThreadA Thread represents a thread.

Functions

love.thread.getChannelCreates or retrieves a named thread channel.
love.thread.getThreadLook for a thread and get its object.
love.thread.getThreadsGet all threads.
love.thread.newChannelCreates a new unnamed thread channel.
love.thread.newThreadCreates a new Thread from a filename, string or FileData object containing Lua code.


See Also

Other Languages