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

SendTo sync with main thread #23

Open
dungeon2567 opened this issue Jul 15, 2020 · 3 comments
Open

SendTo sync with main thread #23

dungeon2567 opened this issue Jul 15, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@dungeon2567
Copy link

Is your feature request related to a problem? Please describe.
Can SendTo be triggered by the main thread? i have a game loop on my game server and want to send all messages at the end of every step
Describe the solution you'd like
Main Thread trigger Event at end of loop, SendTo Thread "WaitsFor" Event to run logic

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@dungeon2567 dungeon2567 added the enhancement New feature or request label Jul 15, 2020
@TwoTenPvP
Copy link
Member

All API's in Ruffles are 100% thread safe and many are threaded under the hood already.

@dungeon2567
Copy link
Author

dungeon2567 commented Jul 16, 2020

Yes, they are thread safe but i want to send all messages exactly on the end of current server tick to optimize latency (my server is already 20 fps, 50 ms per frame)

@dungeon2567
Copy link
Author

Is there anything wrong with this? because even even though both threads run at 20 ticks per second they are not in sync (i write all data that need to be sent this frame before the frame end and i can flush it now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants