Jump to content

To what extent is Minecraft multi-threaded?


Jipthechip

Recommended Posts

I’ve heard that while Minecraft is technically multi-threaded, it is a primarily single threaded game because it does most of the work in a single thread. Is this true?

If so, does that go for servers as well as clients? Would a Minecraft server be able to fully utilize a processor with 8 or even 16 threads, or would a few of these threads not be utilized?

Edited by Jipthechip
Link to comment
Share on other sites

  • 6 months later...
  • 4 months later...
16 minutes ago, Kiljaeden053 said:

Specifically everything Mojang coded. so having separate cores for updating entities, blocks, would make the game faster.

Except that would break every world interaction as well as cause a ton of concurrency issues.

Adding more threads doesn’t mean the game would be faster and better; threading is not a magical solution to all performance issues.

 

Threading should only be used if the routine to be put on another thread makes sense to be on another thread (i.e. make the checking for update routine separate from the main game thread, or separate the render thread from the game logic thread (not Minecraft specific)). It is not as simple as totalTimeUsed / threadCount = actualTimeUsed.

Edited by DavidM
  • Thanks 1

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

29 minutes ago, DavidM said:

Except that would break every world interaction as well as cause a ton of concurrency issues.

Adding more threads doesn’t mean the game would be faster and better; threading is not a magical solution to all performance issues.

 

Threading should only be used if the routine to be put on another thread makes sense to be on another thread (i.e. make the checking for update routine separate from the main game thread, or separate the render thread from the game logic thread (not Minecraft specific)). It is not as simple as totalTimeUsed / threadCount = actualTimeUsed.

In your opinion. What would be the best solution to make the game more optimized on large servers?

Link to comment
Share on other sites

8 minutes ago, Kiljaeden053 said:

In your opinion. What would be the best solution to make the game more optimized on large servers?

Depending on the game type of the server, it may be more up to how server plugins are written rather than the game itself (i.e. mini game servers rely heavily on the performance of the mini game plugins).

 

As for optimizing the game itself, projects like Spigot provide tweaked server jars that might improve server performance.

  • Thanks 1

Some tips:

Spoiler

Modder Support:

Spoiler

1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code.

2. Always post your code.

3. Never copy and paste code. You won't learn anything from doing that.

4. 

Quote

Programming via Eclipse's hotfixes will get you nowhere

5. Learn to use your IDE, especially the debugger.

6.

Quote

The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it.

Support & Bug Reports:

Spoiler

1. Read the EAQ before asking for help. Remember to provide the appropriate log(s).

2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.

 

 

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.