-
Notifications
You must be signed in to change notification settings - Fork 196
Closed
Labels
Description
Hello! I have a game I am working on where recently I have been working towards using more threads and improving performance.
An issue I ran into while doing this, is that my game has 2 types of data:
- Assets which can be moved between threads (including things with Rhai scripts)
- GameState which is always on a single thread, and is passed to scripting as an argument
When trying to make it so I can execute Rhai scripts across threads (splitting my client and server), I found that in order to use things like AST on another thread I needed to enable the sync feature. However, this forces all types to require Sync + Send, which things such as my game state can't do, as some of these references are in fact tied to a specific thread.
Is there any way to get around this to somehow have AST Send + Sync, but not require all arguments to scripts to calling Rhai functions to also be Send + Sync?
agersant