3 Memory use optimisations for Lua mapgens

User avatar
Festus1965
Member
 
Posts: 878
Joined: Sun Jan 03, 2016 11:58
Location: Thailand - Chiang Mai (+5-6h to MEZ)
In-game: Thomas Explorer

Re: 3 Memory use optimisations for Lua mapgens

by Festus1965 » Sun Jan 27, 2019 01:25

I am very sorry,
i struggle with the OOM crash actually read the solutions but dont get sure about before and after!

like the example from here
is it before (i found) Source technic_worldgen/oregen.lua:
changed again and now this 2 lines like shown ... miss understand first, but wondering why "data" instead of "sulfur_buf"
got now better understand and changed, not tested yet.
Server: still up, see some gamer - but there is a new 1st important thread "climate change" for me. Something I know since 1992 - had seen the melting glacier in Switzerland.
 

BuckarooBanzay
Member
 
Posts: 293
Joined: Tue Apr 24, 2018 05:58
Location: Switzerland
GitHub: thomasrudin-mt
In-game: BuckarooBanzai
 

Kurtzmusch
Member
 
Posts: 35
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

Re: 3 Memory use optimisations for Lua mapgens

by Kurtzmusch » Thu Sep 19, 2019 18:04

what happens when you try to recycle the buffers but the engine is set to generate maps with more than 1 emerge threads? should i make a buffer per thread or will the c++ threads take turns in calling my on_generated? sofar once said that lua is single-threaded, but isnt it possible for the engine to spawn 2 lua instances? if the threads do take turns to call on_generated doesnt this mean that a lua mapgen will be 2 to 4 times slower?( considering that most processors are duo or quad core)
Like Puzzles? Escape The Dungeon
 

User avatar
sfan5
Moderator
 
Posts: 3810
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

Re: 3 Memory use optimisations for Lua mapgens

by sfan5 » Thu Sep 19, 2019 21:25

Kurtzmusch wrote:what happens when you try to recycle the buffers but the engine is set to generate maps with more than 1 emerge threads? [...]

Nothing, your Lua code does not have to concern itself with this.

Kurtzmusch wrote:if the threads do take turns to call on_generated doesnt this mean that a lua mapgen will be 2 to 4 times slower?( considering that most processors are duo or quad core)

That's a weird way to put it, but it's technically true since Lua is single-threaded.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 

Previous

Return to News



Who is online

Users browsing this forum: No registered users and 1 guest