Support of multiple cores

vktRus
Member
 
Posts: 67
Joined: Wed May 01, 2013 07:23

Support of multiple cores

by vktRus » Sun May 12, 2013 15:43

I have a multi-core server. But minetestserver loads only one core.
Minetestserver does not support multi-core system?
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sun May 12, 2013 15:51

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.
 

vktRus
Member
 
Posts: 67
Joined: Wed May 01, 2013 07:23

by vktRus » Sun May 12, 2013 19:25

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.
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Sun May 12, 2013 21:01

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%
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

vktRus
Member
 
Posts: 67
Joined: Wed May 01, 2013 07:23

by vktRus » Sun May 12, 2013 21:37

:)

Image
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Sun May 12, 2013 22:03

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.
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Sun May 12, 2013 22:25

vktRus wrote::)

Image

weird...
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

User avatar
BrandonReese
Member
 
Posts: 836
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese

by BrandonReese » Mon May 13, 2013 00:49

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...)
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Mon May 13, 2013 02:17

That is a shame. That means that getting a better CPU won't always help you out.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon May 13, 2013 10:10

This article from the dev wiki describes the usage of threads in Minetest: http://dev.minetest.net/Engine_structure#Threads
Note 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
 

User avatar
vv221
Member
 
Posts: 42
Joined: Mon Mar 04, 2013 08:18

by vv221 » Mon May 13, 2013 12:23

vktRus wrote::)

Image

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%.
 

User avatar
Inocudom
Member
 
Posts: 2889
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

by Inocudom » Mon May 13, 2013 14:03

 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon May 13, 2013 14:10

PilzAdam wrote:This article from the dev wiki describes the usage of threads in Minetest: http://dev.minetest.net/Engine_structure#Threads
Note 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
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon May 13, 2013 14:11

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
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

vktRus
Member
 
Posts: 67
Joined: Wed May 01, 2013 07:23

by vktRus » Mon May 13, 2013 15:49

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%.
Last edited by vktRus on Mon May 13, 2013 15:50, edited 1 time in total.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Mon May 13, 2013 15:57

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
 

tbillion
Member
 
Posts: 189
Joined: Wed Apr 03, 2013 16:07

Re: Support of multiple cores

by tbillion » Fri Nov 27, 2015 12:24

all versions of minetest are multithreaded? or special compile? cuz i would love me some multithread if its not by default :)
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Support of multiple cores

by Hybrid Dog » Mon Dec 07, 2015 17:43

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_delayer

l just tried the emerge threads setting, minetest used every cpu.
 

est31
Member
 
Posts: 172
Joined: Mon Dec 29, 2014 01:49

Re: Support of multiple cores

by est31 » Mon Dec 07, 2015 19:24

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.
 

tbillion
Member
 
Posts: 189
Joined: Wed Apr 03, 2013 16:07

Re: Support of multiple cores

by tbillion » Mon Dec 07, 2015 22:22

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.
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 12 guests

cron