Spawns a new fiber to run
f. Post semantics are used, so the current fiber
(the one calling
spawn()) continues to run until it reaches a suspension
Fibers are the primitive of choice to represent concurrency. Every time you need
to increase the concurrency level, just spawn a fiber. Fibers are
cooperative and only
transfer control to other fibers in well-defined points (sync primitives, IO
functions and any suspending function such as
points are also used by the interruption API.
No two fibers from the same Lua VM run in parallel (even when the underlying VM’s thread pool has threads available).
spawn() is a global so it doesn’t need to be
Returns the values returned by the fiber’s start function. If that fiber exits with an error, that error is re-raised here (and fiber is considered joined).