what does 'simple table' mean in this context? i'd like to make it so that when the original table changes, the thread has access to the changed table, not the original one. is this possible?(The argument may be) a string, number, boolean, LÖVE object, or simple table.
table reference through Thread:start
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
table reference through Thread:start
so i would like to pass a table reference to a thread via Thread:start. the wiki says:
hippity hoppity ur code is my property (thanc in advanc)
Re: table reference through Thread:start
also the Variant page says that
so can Thread:start() take a nested table or no?Nested tables are not officially supported in versions prior to 11.0.
hippity hoppity ur code is my property (thanc in advanc)
- slime
- Solid Snayke
- Posts: 3163
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: table reference through Thread:start
Each thread has a completely independent Lua instance, so sharing tables in that manner isn't possible. When you pass a table into Thread:start or Channel:push it has to copy it.
Re: table reference through Thread:start
oh. sad. i think i'll manage though. nice to know, thx!
hippity hoppity ur code is my property (thanc in advanc)
- zorg
- Party member
- Posts: 3465
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: table reference through Thread:start
It can in version 11.0 and later, but it will still be a copy.
You could use any of the löve provided *Data classes since those only pass a reference between threads... although working with them currently is a bit of a chore, and regardless, you'll need to make sure you're careful with manipulating it at the same time from multiple threads; reading is less problematic than writing it, of course.
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Who is online
Users browsing this forum: Amazon [Bot], Semrush [Bot] and 4 guests