Game server language

Asked 1 years ago, Updated 1 years ago, 65 views

Hi, everyone.

I was only studying web development, but suddenly I was curious about what language the game server was made, so I left a question. I tried googling with game server language first, but I can't see the recent writing. Most of them are c# and c++, and node.js seems to be emerging, so I would like to hear what the experts in the hash code think.

Thank you.

game-server server language

2022-09-22 19:30

1 Answers

Language doesn't matter.

Due to the nature of many users accessing the game server, event-based asynchronous calls must be used.

For example, if you want to cover many users, the multi-threaded approach is difficult to solve the c10k problem.

When you create a thread in a window, you need to create 1 megabyte of stack space by default. If it's 10,000 threads...It is concluded that 10 gigabytes are needed simply by calculation.

However, 32-bit os can use up to 4 gigabytes of memory, of which 1 to 2 gigabytes is occupied by the kernel area. In other words, it is difficult to solve c10k with multi-threaded methods.

Asynchronous event solutions available include iocp on the Windows side and epoll on the Linux side.

It's been made a lot with Windows and iOS for a while, and it's still the best in terms of performance and availability.

However, from the perspective of event-based asynchronous call, I think epoll and iocp are similar. (There will be quite a few benchmarks on the Internet)

In other words, it is developed using iocp for Windows servers and epoll for Linux.

So let's think about the language question that the questioner is curious about.

In fact, both icop and epoll are available in capi. It means c/c++ is the language that can produce the best results. We're actually going to adopt c/c++ as our server development language.

But c/c++ has a productivity drawback, so we don't use c/c++ everywhere. You can handle iocp with dot-net, you can use epoll with jni with Java, and epoll is available at the Java standard library level (nio).

One of the big themes of modern languages today is async, await. It's called asynchronous. The Go language incorporates a coroutine function called goroutine into the language, and node.js provides asynchronous processing by the underlying architecture.

In the past, the functions of the operating system called iocp and epoll were uncomfortably used, but now it seems to be an era of linguistic provision.


2022-09-22 19:30

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.