A thread is similar to a function. It executes the code within. The only difference is that threads are executed concurrently. Threads are created using the coroutine library. For now, we shall refer to threads as coroutines. A coroutine by default is in an idle state. In order to resume it you must pass it to the resume function. You can also check the status of a coroutine. See the Coroutine Library article for more detail.
The following is an example of execution with threads.