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

Requiring 'static for FilesystemMT seems too strict #26

Open
pedrocr opened this issue Jan 28, 2018 · 1 comment
Open

Requiring 'static for FilesystemMT seems too strict #26

pedrocr opened this issue Jan 28, 2018 · 1 comment

Comments

@pedrocr
Copy link

pedrocr commented Jan 28, 2018

I'm trying to keep a reference to part of my FilesystemMT implementation to be able to have concurrent threads managing state (e.g., sync to disk every X seconds). The signature of FuseMT::new() requires 'static which makes this harder to do. Would it make sense to use crossbeam::scope or something similar to allow having both the fuse_mt and implementation threads run properly scoped?

@pedrocr
Copy link
Author

pedrocr commented Jan 28, 2018

Here's the hack I had to implement to make it work right now:

https://github.com/pedrocr/syncer/blob/4afc7620ce66fbb57425819502570936d898e159/src/lib.rs

It seems to work fine and shouldn't actually be all that unsafe but it would be nice if there was some standard way of having helper threads controlled by the implementation to do housekeeping tasks in the background.

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

No branches or pull requests

1 participant