简体   繁体   中英

How can multiple cores/threads be combined into a single thread?

I run a big minecraft server, minecraft server side is single threaded. Everything is done in the main game loop. If Mojang made minecraft server side multhreaded, Minecraft servers would save 2 million dollars a year from renting less hardware.

Anyway I have heard of these rumors and theories. I've never been able to google it up and figure it out.

Is there anyway to take a multi core cpu, and convert it into a single core, single thread?

I've been speculating that a hyperviser software would be run multithreaded and if it can be configured single core, it would convert multiple cores into a single core.

I approached my java programmer friend with this idea. And he told me that it was impossible because there is no way each individual threads could know what to do. I don't remember what he said exactly, but he basically said it was impossible.

Minecraft servers are spending upwards of 700 dollars a month on renting hardware overclocked to 4.5 ghz. Why? because default servers cost 100-150 and are at 3.8 to 4.5.

An overclocked server will increase the single thread performance by 1/8th. This will cause the server to hold more players. The more players a server can hold, the more money it can make.

So instead of buying overclocked over prices servers, it would be much more efficient to buy quad proq E5 servers and hook them up into one thread, breaking all records for performance and player count.

I understand the most efficient thing would be for mojang to just make minecraft multithreaded. This would require a complete rewrite of all the code.

They don't want to do that. A minecraft account costs 26 dollars. They have sold 20 million. They are rolling in the dough filthy rich, making stupid content updates instead of fixing minecraft servers to be multithreaded.

even minecraft game client isnt multithreaded.

So the question is, is it possible to combine multiple cpu cores to achieve godly single thread performance? if so, how?

I've heard it can be done but the overhead would be crazy.

Anyway of calculating the overhead?

If there was a way to do this, we'd be doing it. The problem is simple -- the program we are running only provides us a single stream of instructions.

Imagine the steps a person goes through to get ready for work in the morning. They get up, take a shower, get dressed, make breakfast, eat breakfast, and so on. With the full list of steps, you could probably figure out efficient ways to overlap the tasks if you had more than one person. One person could pick the clothes while someone else was making breakfast, for example. But if you were only told each step when the previous step was complete, it would be hopeless.

Single-threaded code only tells you each step when the previous step is complete.

Minecraft would require a total recode, as there is currently no way to make a program not designed to multicore use more then one core. Fortunately, several groups have actually done a recode, with PaperMC being the biggest. I do not know, however, if their multicore project actually worked out. A mod called sodium for fabric as well as OptiFine both allow for multicoring on the client. You can even vote for Mojang to do this on the suggestions website at feedback.minecraft.net.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM