Skip to content

Should SftpSession and Channel be wrapped in an Arc for thread safety or not? #308

Answered by Eugeny
kanpov asked this question in Q&A
Discussion options

You must be logged in to vote

Depends on what you're doing. If you actually share the reference to the structs between your own threads, you need to wrap it in Arc<Mutex> like every other non-Sync object. If the moving only happens due to async futures migrating between executor threads, you don't need it.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@kanpov
Comment options

@Eugeny
Comment options

@kanpov
Comment options

@Eugeny
Comment options

Answer selected by kanpov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants