coroutine.create()coroutine.new()coroutine.start()coroutine.begin()coroutine.create() function do in Lua?
coroutine.resume()coroutine.start()coroutine.execute()coroutine.run()coroutine.resume() in Lua?
coroutine.yield() function behave?
coroutine.yield() in Lua?
coroutine.status()coroutine.isfinished()coroutine.check()coroutine.resume()coroutine.status() return if a coroutine has completed its execution?
"dead""running""suspended""active"coroutine.status() return if a coroutine is currently running?
"running""suspended""dead""active"coroutine.resume() function typically used in Lua?
coroutine.create()coroutine.resume()coroutine.create()coroutine.resume()coroutine.yield()coroutine.resume() indicate in Lua?
| Qno | Answer (Option with the text) |
|---|---|
| 1 | b) A function that can pause and resume execution |
| 2 | a) Coroutines can pause and resume execution |
| 3 | a) They allow multiple tasks to run concurrently |
| 4 | a) They allow non-blocking asynchronous code |
| 5 | a) Ability to pause and resume execution |
| 6 | b) Performing asynchronous tasks |
| 7 | a) They cannot run in parallel threads |
| 8 | a) coroutine.create() |
| 9 | a) It creates a new coroutine |
| 10 | a) coroutine.resume() |
| 11 | a) It starts a coroutine’s execution |
| 12 | a) It pauses the coroutine and allows other code to run |
| 13 | a) To pause the execution of the coroutine |
| 14 | a) By using coroutine.status() |
| 15 | a) "dead" |
| 16 | a) "running" |
| 17 | a) After creating a coroutine with coroutine.create() |
| 18 | a) A coroutine starts running immediately after being created |
| 19 | a) By passing arguments to coroutine.resume() |
| 20 | a) If the coroutine was successfully resumed |
| 21 | a) Handling time-consuming or blocking tasks without freezing the program |
| 22 | a) To manage animation frames and other non-blocking tasks |
| 23 | a) Handling user input while performing background computations |
| 24 | a) Handling user interfaces and animations without freezing the game |
| 25 | a) By manually yielding control between tasks in the program |
| 26 | a) By suspending and resuming tasks at specific points in the code |
| 27 | a) Yes, to handle multiple connections without blocking the main thread |
| 28 | a) They allow code execution to be paused and resumed without blocking the main thread |
| 29 | a) Coroutines use less memory and do not require thread management |
| 30 | a) By maintaining state transitions without blocking execution |