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

Example of using Sync Send on vTable #9

Open
Bengreen opened this issue Feb 22, 2024 · 0 comments
Open

Example of using Sync Send on vTable #9

Bengreen opened this issue Feb 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Bengreen
Copy link

Bengreen commented Feb 22, 2024

Is your feature request related to a problem? Please describe.

I am creating an FFI library where I want to pass in a number of thing_trait_objects. I then store these into an object and this object is used within a web service (ie Warp inside Tokio). For this to work the object I pass in needs to be Sync + Send. Sync + Send depend upon the enclosed objects. In particular the vTable is giving me the error NonNull<HealthProbeFuncsVtable> cannot be sent between threads safely`
How can I enable the vTable to be Safe + Sync

Describe the solution you'd like

An example of how to add Sync + Send to the vTable. And some discussion on risks or why/why not.

Describe alternatives you've considered

I don't really see an alternative on having Sync + Send available. I was wondering if I can explicitly add this and unsure if that is sensible/safe.

Additional context

Not that I can think at moment.

@Bengreen Bengreen added the enhancement New feature or request label Feb 22, 2024
@Bengreen Bengreen changed the title Example of using Sync Send on Table Example of using Sync Send on vTable Feb 22, 2024
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

1 participant