4
According to the manual of version 5.3, a thread type value represents independent execution topics:
The type thread represents Independent threads of Execution and it is used to implement coroutines (see §2.6). Moon threads are not Related to Operating-system threads.
Does this mean that every time the body/scope of a function is executed a new thread is created? Or does this happen with all kinds of scope? For example:
-- Cria um thread (principal)
(function()
-- Cria um thread
for i = 1, 2 do
-- Cria outro thread
end
end)();
Or with functions only:
-- Cria um thread (principal)
(function()
-- Cria um thread
for i = 1, 2 do
end
end)();
I don’t understand where you got your interpretation from. "The Type
thread
represents independent thread execution and is used to implementcoroutines
. What do you mean by block? Aif
, oneloop
? If it is, it’s a matter of language scope.– user3603
@Gerep When I refer to the block I refer to a list of statements (a statement is an statement that is not an expression)
– Klaider