Page 1 of 1
Support of multiple cores

Posted:
Sun May 12, 2013 15:43
by vktRus
I have a multi-core server. But minetestserver loads only one core.
Minetestserver does not support multi-core system?

Posted:
Sun May 12, 2013 15:51
by Calinou
Not really, Minetest rarely uses multiple cores. However, it's still a good thing to have multiple cores (at least 2), so that background tasks do not slow the Minetest server down.

Posted:
Sun May 12, 2013 19:25
by vktRus
I have 8 cores (HP :). But the server load at a time only one core. Sometimes >100%. This occurs when a player goes to the new territories.

Posted:
Sun May 12, 2013 21:01
by 12Me21
vktRus wrote:I have 8 cores (HP :). But the server load at a time only one core. Sometimes >100%. This occurs when a player goes to the new territories.
It's impossible to be over 100%

Posted:
Sun May 12, 2013 21:37
by vktRus
:)


Posted:
Sun May 12, 2013 22:03
by Inocudom
Does this mean that Minetest only uses one core of a quad-core CPU? I never knew there was anything to keep a program from using more than one core of a CPU that has more than one core.

Posted:
Sun May 12, 2013 22:25
by 12Me21
vktRus wrote::)

weird...

Posted:
Mon May 13, 2013 00:49
by BrandonReese
Inocudom wrote:Does this mean that Minetest only uses one core of a quad-core CPU? I never knew there was anything to keep a program from using more than one core of a CPU that has more than one core.
For a program to take advantage of multiple cores it has to be multi-threaded, otherwise all instructions for a program are executed on a single core. If minetest was multi threaded it would use mutliple cores but then things get complicated with interproccess communication and synchronization. (ie the mapgen thread has to talk to the thread that sends data to the users, etc...)

Posted:
Mon May 13, 2013 02:17
by Inocudom
That is a shame. That means that getting a better CPU won't always help you out.

Posted:
Mon May 13, 2013 10:10
by PilzAdam
This article from the dev wiki describes the usage of threads in Minetest:
http://dev.minetest.net/Engine_structure#ThreadsNote that you can change some etting in minetest.conf to use more threads:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
# This specifies the number of threads used for world generation
num_emerge_threads = 1
# And this how many threads are used to download media from a server that uses cURL
media_fetch_threads = 8

Posted:
Mon May 13, 2013 12:23
by vv221
vktRus wrote::)

The value you see is here the sum of all of your cores.
It does mean the equivalent of 1.01 core is used, obviously from two cores. (probably 100% from the core running Minetest, and 0.01% from another core running background tasks)
12Me21 is right when he says it is impossible to use a core over 100%.

Posted:
Mon May 13, 2013 14:03
by Inocudom

Posted:
Mon May 13, 2013 14:10
by sfan5
PilzAdam wrote:This article from the dev wiki describes the usage of threads in Minetest:
http://dev.minetest.net/Engine_structure#ThreadsNote that you can change some etting in minetest.conf to use more threads:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
# This specifies the number of threads used for world generation
num_emerge_threads = 1
# And this how many threads are used to download media from a server that uses cURL
media_fetch_threads = 8
The second setting if only for the client

Posted:
Mon May 13, 2013 14:11
by sfan5
BrandonReese wrote:Inocudom wrote:Does this mean that Minetest only uses one core of a quad-core CPU? I never knew there was anything to keep a program from using more than one core of a CPU that has more than one core.
For a program to take advantage of multiple cores it has to be multi-threaded, otherwise all instructions for a program are executed on a single core. If minetest was multi threaded it would use mutliple cores but then things get complicated with interproccess communication and synchronization. (ie the mapgen thread has to talk to the thread that sends data to the users, etc...)
You don't need IPC for threads, since threads share their memory with the main process

Posted:
Mon May 13, 2013 15:49
by vktRus
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
# This specifies the number of threads used for world generation
num_emerge_threads = 3
Does not help. When generating new locations load only on one core 100%.

Posted:
Mon May 13, 2013 15:57
by rubenwardy
BrandonReese wrote:Inocudom wrote:Does this mean that Minetest only uses one core of a quad-core CPU? I never knew there was anything to keep a program from using more than one core of a CPU that has more than one core.
For a program to take advantage of multiple cores it has to be multi-threaded, otherwise all instructions for a program are executed on a single core. If minetest was multi threaded it would use mutliple cores but then things get complicated with interproccess communication and synchronization. (ie the mapgen thread has to talk to the thread that sends data to the users, etc...)
Minetest
IS multithreaded
Re: Support of multiple cores

Posted:
Fri Nov 27, 2015 12:24
by tbillion
all versions of minetest are multithreaded? or special compile? cuz i would love me some multithread if its not by default :)
Re: Support of multiple cores

Posted:
Mon Dec 07, 2015 17:43
by Hybrid Dog
tbillion wrote:all versions of minetest are multithreaded? or special compile? cuz i would love me some multithread if its not by default :)
the mods' thread is a single one, if you use more than one, it wouldn't be possible to e.g. override minetest.get_node directly in specific situations, e.g. exactly when minetest.set_node placed stone
l tried to make a scheduler mod. It maybe works for spawning lots of trees fairly at once:
https://github.com/HybridDog/function_delayerl just tried the emerge threads setting, minetest used every cpu.
Re: Support of multiple cores

Posted:
Mon Dec 07, 2015 19:24
by est31
Parts of minetest are multithreaded, parts aren't.
First of all, minetest uses irrlicht, which uses either directx or opengl. This means that communication with the graphics card is only possible in one thread. I know that directx has seen some changes recently, but irrlicht doesn't support them, and its a large project overall to retrofit multithreading. I highly doubt we will ever see multi threaded gfx card communication in irrlicht.
minetest itself _is_ multithreaded. It has multiple mapgen threads, and it has separate client and server threads. Yes, that's not alot, and there are limitations, like no real multithreading for lua mapgen. Still, you don't do everything in only one thread.
Re: Support of multiple cores

Posted:
Mon Dec 07, 2015 22:22
by tbillion
lol some people talk worker threads others talk performance threads, as much as we wish it was this isnt a billion dollar corporation :) and we dont get paid to mod (well i dont :) so we shoudl be happy with what it is or go play on java, it will get better as time goes by.