#courotines

22 messages · Page 1 of 1 (latest)

onyx yacht
#

What?

#

coroutines are used to spawn new threads and the task library is a front for the task scheduler

#

Make 4 threads then

#

By using coroutines or task library

#

No

#

🤷‍♂️

#

No because that isn't how coroutines work

#

or what coroutines are in general

onyx yacht
#

Each loop can be its own thread, you can find out how to use them on the documentation

unique ridge
#

what is set.coroutine?

#

did you mean task.spawn()?

#

maybe task.delay?

#

coroutine and task are closely related. tasks start automatically, coroutines wait until you specifically tell it to start.

onyx yacht
#

Well task.spawn is coroutines

unique ridge
#

you can technically do t=task.spawn(function() coroutine.yield() end) ... and then later ... task.spawn(function() coroutine.resume(t) end) .. for a non-blocking coroutine resume. without the task.spawn the thread calling resume will yield until the coroutine returns or yields again

#

etc etc. pretty sure that's about right

onyx yacht
#

You can also just task.spawn() a created coroutine

unique ridge
#

ah right i forgot about that

hearty lanternBOT
#

studio** You are now Level 9! **studio