Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDClient rework #623

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

CDClient rework #623

wants to merge 9 commits into from

Conversation

Wincent01
Copy link
Member

Utilizes boost::interprocess to share maps between worlds.
The master server loads the tables into memory, and the worlds hook into it when they want to get an entry.

This solves the issue of skill delay and saves memory, but introduces the third-party library Boost.
There should be a conversation about the introduction of Boost — it is a large library and adds extra steps to the installation. Other options should be considered.

Utilizes `boost::interprocess` to share a map between worlds.
The master server loads the table into memory, and the worlds hook into it when they want to get an entry.

This solves the issue of skill delay, but introduces the third-party library Boost.
There should be a conversation about the introduction of Boost — it is a large library and adds extra steps to the installation.
@Wincent01 Wincent01 requested a review from EmosewaMC July 9, 2022 21:02
@Jettford
Copy link
Collaborator

Jettford commented Jul 9, 2022

I don't personally believe that adding a library as large as boost is worth it for saving 18mb per world server. Other options should be investigated first in my opinion.

Load the context at start in readonly mode instead of fetching for every entry.
@codeshaunted
Copy link
Member

I don't personally believe that adding a library as large as boost is worth it for saving 18mb per world server. Other options should be investigated first in my opinion.

I don't want to add boost either but this is a pretty significant memory save... Are there any other similar cross platform IPC libraries? You could also just use pipes but that could get a bit sketchy.

@Wincent01
Copy link
Member Author

This method doesn't utilize pipes, it uses shared memory, the sh & mmap set of functions for Unix. Win32 also has a solution for it, but different API.

That are some wrappers for these os dependent functions like this one here, but would leave us with a lot of work. Boost comes with ready custom allocators and other utility, likely more optimized than anything we'd come up with.

Wincent01 and others added 7 commits July 18, 2022 16:44
There is now an option to utilize shared memory for some CDClient tables by adding `CD_PROVIDER_MEMORY=1` to the CMakeVariables.txt file.

Allows masterconfig.ini to specify another run command for the world server, to allow for easier debugging through `valgrind`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants