Mod threads
Mod threads
Does minetest use one threads for all mods now or a thread per each mod?
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Mod threads
Lua runs on one thread - you can notice the lag when a Lua mapgen generates terrain.neko259 wrote:Does minetest use one threads for all mods now or a thread per each mod?
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: Mod threads
Does anyone work to make it use more threads? I think this would greatly improve performance. Or am I wrong?Krock wrote:Lua runs on one thread - you can notice the lag when a Lua mapgen generates terrain.neko259 wrote:Does minetest use one threads for all mods now or a thread per each mod?
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Mod threads
The serverlist already uses async HTTP requests to get the data.neko259 wrote:Does anyone work to make it use more threads? I think this would greatly improve performance. Or am I wrong?
I'm not sure if the threads could conflict each other.
You can start developing anytime.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Re: Mod threads
I'm not very familiar with C++, and can do almost nothing for multithreading in lua. If minetest was in python or java...Krock wrote:You can start developing anytime.
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: Mod threads
In the sims 3, each object has its own thread. It works because they can request a resource and lock it.
You would need to completely redesign the modding API. It is very unlikely to happen.
You would need to completely redesign the modding API. It is very unlikely to happen.
Re: Mod threads
Why do you have to break or change anything? The only thing that will be locked is working with the server (and the locking can be done on the server without changing mods api).rubenwardy wrote:In the sims 3, each object has its own thread. It works because they can request a resource and lock it.
You would need to completely redesign the modding API. It is very unlikely to happen.
If you mean that one mod can use other mod, I can agree. But in that case, we can at least make a separate thread for all mods, not make them work in the same thread as server.
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Mod threads
I’m happy that it isn’t. Python is awesome and Java is …uhm … versatile … in a way. But both aren’t optimized for performance.neko259 wrote:If minetest was in python or java...
Re: Mod threads
Don't judge them on the software you seen on the internet. They can be very perfomant, but you won't see good optimized java applications that are used in enterprise.Linuxdirk wrote:I’m happy that it isn’t. Python is awesome and Java is …uhm … versatile … in a way. But both aren’t optimized for performance.neko259 wrote:If minetest was in python or java...
- Linuxdirk
- Member
- Posts: 3219
- Joined: Wed Sep 17, 2014 11:21
- In-game: Linuxdirk
- Location: Germany
- Contact:
Re: Mod threads
Every good Java fanboy knows: “Java is the fastest programming language in the world, programmers just do it wrong all the time”. Same with Python fanboys (I’m sometimes one of them, but only a little *g*).neko259 wrote:They can be very perfomant, but you won't see good optimized java applications that are used in enterprise.
The problem is: Both languages are interpreted. Interpreted languages are always slower than compiled languages performing the same task.
I’m happy that the Minetest code is written in a compiled language for all the critical tasks. I wish mods would use Python instead of Lua but that’s not that much of a problem since Lua is pretty easy to understand.
Re: Mod threads
This is true in words, but in real life the difference between 99.5% and 100% performance is not always seen. And interpreted languages can speed up development (even optimizations development) and make mistakes less frequent. I don't think percents of speed in some places are more important that the absense of segfaults.Linuxdirk wrote:The problem is: Both languages are interpreted. Interpreted languages are always slower than compiled languages performing the same task.
I’m happy that the Minetest code is written in a compiled language for all the critical tasks. I wish mods would use Python instead of Lua but that’s not that much of a problem since Lua is pretty easy to understand.
- ArguablySane
- Member
- Posts: 116
- Joined: Sun Oct 12, 2014 21:29
Re: Mod threads
Honestly I'd rather write mods in Java, not because I prefer the language but because it would be faster. When trying to do iteration-heavy mapgen in lua I'm always conscious of the fact that it's going to run significantly slower than native code.Linuxdirk wrote:I’m happy that the Minetest code is written in a compiled language for all the critical tasks. I wish mods would use Python instead of Lua but that’s not that much of a problem since Lua is pretty easy to understand.
The above post and any ideas expressed therein are released to the public domain under a Creative Commons CC0 license.
- rubenwardy
- Moderator
- Posts: 6978
- Joined: Tue Jun 12, 2012 18:11
- GitHub: rubenwardy
- IRC: rubenwardy
- In-game: rubenwardy
- Location: Bristol, United Kingdom
- Contact:
Re: Mod threads
Ironic how ruby is more pythonic than python. In my opinion, anyway. (As long as you use it right, of course)
Who is online
Users browsing this forum: No registered users and 9 guests