Will a thread or/and channel get dereferenced automatically?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
Fabimawn
Prole
Posts: 23
Joined: Wed Jan 04, 2023 11:28 am
Location: Lua

Will a thread or/and channel get dereferenced automatically?

Post by Fabimawn »

Hello,

I'm working on a desktop application which works with multiple thread instances to execute some commands in a CLI, but I now wonder if I manually have to dereference the thread instances when they're finished with the :release method, since it seems I can still pull data from the channels after they've finished execution.

Are the thread channels independent of the threads that pushed data into them and created them? Or how does it work exactly, since I can't seem to find a similar topic on this so quickly and on the thread documentation this isn't explained in depth.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Will a thread or/and channel get dereferenced automatically?

Post by slime »

Channel objects aren't owned by a specific thread, they're reference-counted across threads like other love objects.
User avatar
Fabimawn
Prole
Posts: 23
Joined: Wed Jan 04, 2023 11:28 am
Location: Lua

Re: Will a thread or/and channel get dereferenced automatically?

Post by Fabimawn »

Thanks!
Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 7 guests