Difference between revisions of "love.thread (简体中文)"
(Created page with "{{newin|0.7.0|070|type=module}} Allows you to work with threads. 线程是独立的Lua环境,平行运行于主代码。它们分别运行各自的代码,可以用来进...") |
m |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
{{newin|[[0.7.0]]|070|type=module}} | {{newin|[[0.7.0]]|070|type=module}} | ||
− | + | 允许你用模块工作. | |
线程是独立的Lua环境,平行运行于主代码。它们分别运行各自的代码,可以用来进行复杂的操作而不影响主线程的帧速率。然而,因为它们是独立的环境下,所以它们不能访问主线程的变量和函数,以及线程间的通信。 | 线程是独立的Lua环境,平行运行于主代码。它们分别运行各自的代码,可以用来进行复杂的操作而不影响主线程的帧速率。然而,因为它们是独立的环境下,所以它们不能访问主线程的变量和函数,以及线程间的通信。 | ||
Line 20: | Line 20: | ||
{{#set:Since=070}} | {{#set:Since=070}} | ||
== See Also == | == See Also == | ||
− | * [[parent::love]] | + | * [[parent::love (简体中文)]] |
== Other Languages == | == Other Languages == | ||
{{i18n|love.thread}} | {{i18n|love.thread}} |
Latest revision as of 23:01, 27 March 2013
Available since LÖVE 0.7.0 |
This module is not supported in earlier versions. |
允许你用模块工作.
线程是独立的Lua环境,平行运行于主代码。它们分别运行各自的代码,可以用来进行复杂的操作而不影响主线程的帧速率。然而,因为它们是独立的环境下,所以它们不能访问主线程的变量和函数,以及线程间的通信。
当一个线程启动时, 它只加载love.thread模块. 所有其他的模块需要用require加载.
love.graphics模块有一些限制,因此它应该只在主线程使用. |
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