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

worker thread cleanup and Drop #100

Open
jstrong-tios opened this issue Feb 26, 2019 · 0 comments
Open

worker thread cleanup and Drop #100

jstrong-tios opened this issue Feb 26, 2019 · 0 comments

Comments

@jstrong-tios
Copy link

I haven't been able to find any documentation about how worker threads which don't interact directly with ruby objects are handled in terms of Drop. In my case I have existing rust code which establishes a long-running thread worker to handle incoming "jobs" via a channel. The thread "lives" in a struct that implements Drop, which tells the thread to stop waiting for new messages and terminate when it's dropped (glossing over details here). In this case, my expectation is the rust/ruru interface to ruby can cleanly send data (perhaps copied data) from ruby over the channel to the thread worker. Would the thread worker need to be setup with the Thread struct in ruru (Thread::call_without_gvl)? Or could I use std::thread? Will Drop be called when the parent struct is destroyed?

Thanks for any help you can provide.

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