Returns an array of the live Luau threads the garbage collector is currently tracking in the calling Lua state.

Returns

table
A fresh array (1-indexed) of live threads.

Behavior

  • Only live threads are returned; dead threads are skipped.
  • The result is scoped to the current Lua state. Threads running in other Actor VMs are not included here.
  • This is equivalent to the thread subset of getgc(true) but walks only for threads, so it allocates less and reads more clearly when threads are all you need.

Example

Report the status of every live thread:

Errors

getallthreads does not raise under normal conditions.
  • getgc: all collectable objects, not just threads.
  • gettenv: read a thread’s global environment.