Shared memory usage in TrinityCore

Hi there

TrinityCore is an awesome project. I’m developing an MMO game and in trinity I have found lots of good development practices. Keep on the good work guys!

For my own game I need to have a shared memory between several executable. I recall a time when trinity used ACE for inter-process communication and data sharing, but now I see ACE is completely removed and boost with c++11 is being used instead. I know that boost::interprocess wraps around posix shared memory, But I don’t see it anywhere withing gameserver!

Can I have your views on this matter? Why did you replace ACE and what are you using instead?

In the 6.x branch we are using ZeroMQ for IPC between bnetserver and worldserver, take a look at that.

​If TC was started from scratch we would change a LOT. So be careful, there’s some really bad parts on current TC

In the 6.x branch we are using ZeroMQ for IPC between bnetserver and worldserver, take a look at that.

Thanks, That’s what I was searching for.

If TC was started from scratch we would change a LOT. So be careful, there’s some really bad parts on current TC

Of course, this is true with almost every project /emoticons/default_wink.png Thanks for mentioning though.

We never used ACE for ipc (never had any for of ipc actually before unless you count sharing data through login database as such)

If you need shared memory specifically (ZMQ works on tcp sockets which is exactly what we need as world & bnet servers don’t have to run on the same machine) then you should use boost.interprocess

I was searching for different shared memory usage libraries. My project needs small but frequent passing of data between three different executables. I primarily asked for ACE because I could use ACE’s inter-process communication to use RPC on each executable without a need for lock on shared data. But later I decided to use pure shared memory and control locking the data myself. I also extended my search to online data sharing solutions like redis and also to nosql databases like mongodb.

I made my choice based on some tests I conducted on my own, and I’m providing a brief report here for people who are interested on this topic. On a fixed hardware setup I tested how many increments were possible on a single integer. I used the latest redis and mongodb for the tests. What I tested was number of increments recorded in a second:

Pure c++ increment: 18.5 Mrps (Million requests per second to increment an integer)
Boost’s Interprocess library: 13.8 Mrps
Redis: 50 Krps (With one client fully sync mode), 1.03 Mrps (With 8 clients async mode)
MongoDB: 30 Krps (With one client), 95 Krps (With 8 clients)

I’m not writing out all the details with experiments, but if anyone needs to know the details, I will be available.