What the title says.
Do threads cache require'd modules?
And if they do, is this the same cache as the main thread? Or do threads get their own cache?
Do requires in threads get cached? Are they cached separately from the main thread?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Guard13007
- Party member
- Posts: 132
- Joined: Sat Oct 25, 2014 3:42 am
- Location: Internet, USA
- Contact:
- zorg
- Party member
- Posts: 3444
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: Do requires in threads get cached? Are they cached separately from the main thread?
Threads (real ones with love.thread, not coroutines) have their own Lua states;
They don't "share" anything on the lua side, which includes modules required (including löve's ones like love.timer; love.thread is the only one that gets loaded automatically... although love.filesystem gets loaded too since either 0.9 or 0.10)
Also, all of this is on the wiki: love.thread
They don't "share" anything on the lua side, which includes modules required (including löve's ones like love.timer; love.thread is the only one that gets loaded automatically... although love.filesystem gets loaded too since either 0.9 or 0.10)
Also, all of this is on the wiki: love.thread
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.
- Guard13007
- Party member
- Posts: 132
- Joined: Sat Oct 25, 2014 3:42 am
- Location: Internet, USA
- Contact:
Re: Do requires in threads get cached? Are they cached separately from the main thread?
I don't believe that answers my question. I am aware that Love modules must be loaded and that they are their own states, but they also allows flat tables and userdata to be shared. I am wondering if that sharing applies to cached modules (although based on having to require love's modules and it being a separate state, I'm guessing no). And I'm guessing now that this means they /do/ cache require'd modules in their own thread only.
Edit: Sorry if I sounded rude. I'm half awake and trying to just make sure I understand it properly. >.<
Edit: Sorry if I sounded rude. I'm half awake and trying to just make sure I understand it properly. >.<
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Do requires in threads get cached? Are they cached separately from the main thread?
No, even data sent over channels isn't shared unless they're love objects. The tables are copied over, and, of course, you can't send functions to begin with.
Who is online
Users browsing this forum: Amazon [Bot], Bing [Bot] and 82 guests