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

ActionChain Cleanup #983

Merged
merged 2 commits into from
Sep 1, 2018
Merged

ActionChain Cleanup #983

merged 2 commits into from
Sep 1, 2018

Conversation

Mag-nus
Copy link
Member

@Mag-nus Mag-nus commented Aug 31, 2018

This removes the unecessary ActionChains that were wrapping many of the HandleActionGameEvent functions.

ActionChains should only be used to enqueue work with delays, or, explicitly queue work for another WO that absolutely must be run on the landblock thread that owns the WO. (very rare, if any cases?)

We do not need to worry about out of order operations with HandleActionGameEvents. These handlers are enqueued when they are received on the network threads. They are then executed in a single thread in our UpdateWorld loop. This pattern is unlikely to change, and allows us to make the assumption that code executed from any HandleAction function (and not from an action chain) does not need to worry about thread safety, as it is the only thread modifying the world.

Parallelization will be added for Physics and Landblocks.Tick() at a future date.

This removes the unecessary ActionChains that were wrapping many of the HandleActionGameEvent functions.

ActionChains should only be used to enqueue work with delays, or, explicitly queue work for another WO that absolutely must be run on the landblock thread that owns the WO. (very rare, if any cases?)

We do not need to worry about out of order operations with HandleActionGameEvents. These handlers are enqueued when they are received on the network threads. They are then executed in a single thread in our UpdateWorld loop. This pattern is unlikely to change, and allows us to make the assumption that code executed from any HandleAction function (and not from an action chain) does not need to worry about thread safety, as it is the only thread modifying the world.

Parallelization will be added for Physics and Landblocks.Tick() at a future date.
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Game play tested, and everything appears to be working as it did before these changes

@Mag-nus Mag-nus merged commit 095df29 into ACEmulator:master Sep 1, 2018
@Mag-nus Mag-nus deleted the working branch September 2, 2018 00:43
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.

None yet

1 participant