Just curious
How luajit/love handles cpus with severals cores and threads?
Does it's something that i should care about or luajit/love takes care of it?
Does luajit/love will properly use, for example, cpu with 8 cores? 16?
Or luajit/love will use, for example, 4 cores because it can't use more?(Like some really old games, etc)
LuaJIT/Love multicore
LuaJIT/Love multicore
Last edited by GVovkiv on Wed Nov 10, 2021 11:00 pm, edited 1 time in total.
Re: LuaJIT/Love multicore
Don't use multithreading if you can make same without it
https://love2d.org/wiki/love.thread
https://love2d.org/wiki/love.thread
Re: LuaJIT/Love multicore
As far as i know, lua's threads how nothing in common with cpu's cores, so if that true, i don't mean thatdarkfrei wrote: ↑Wed Nov 10, 2021 10:47 pm Don't use multithreading if you can make same without it
https://love2d.org/wiki/love.thread
I just curious about how luajit/love deals with cpu with several cores, nothing more
I was never (at the moment) situation, where i really need that
And because i don't know (at the moment) C and i don't know what "google" is, I just want to ask that from someone who know how that works
thats all
Re: LuaJIT/Love multicore
A single core is utilized by default. You can manually create threads with love.thread.newThread. They are real threads, scheduled by the OS across available cores. You can send data safely between threads over channels, but actual memory sharing is limited and there are none of the usual synchronization primitives available.
Re: LuaJIT/Love multicore
Oh, so that REAL threads?grump wrote: ↑Wed Nov 10, 2021 11:10 pm A single core is utilized by default. You can manually create threads with love.thread.newThread. They are real threads, scheduled by the OS across available cores. You can send data safely between threads over channels, but actual memory sharing is limited and there are none of the usual synchronization primitives available.
Huh, now that makes that more clear to me, thanks
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: LuaJIT/Love multicore
Lua's "fake" threads are coroutines; löve's threads are real, and the only way to actually utilize multiple cpu cores. (well, the audio processing already happens on a separate thread anyway)
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.
Re: LuaJIT/Love multicore
Yeah, looks like i was confused with lua's coroutines and love's threads
Maybe it should be mentioned in https://www.love2d.org/wiki/love.thread with something like "love.thread can interact with cpu's cores/threads, do not confuse it with lua's coroutines" so someone like me will be never confused with it
Who is online
Users browsing this forum: No registered users and 5 guests