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

sharing client across multiple goroutines #82

Open
unusualevent opened this issue Aug 10, 2023 · 4 comments
Open

sharing client across multiple goroutines #82

unusualevent opened this issue Aug 10, 2023 · 4 comments

Comments

@unusualevent
Copy link

Is it possible to share the tor client object or the dialer across multiple goroutines?

I end up getting segfaults on the result (but that's probably just me being bad with pointers in the result channel in go)

what's the right way to share it or have multiple requests (say, two at the same time)?

@cretz
Copy link
Owner

cretz commented Aug 10, 2023

The response of the connection is locked and I don't remember, but you probably cannot use the client in multiple goroutines simultaneously. I suspect if I also locked the request you could, but the safest way is to only use from a single goroutine and make multiple clients if needed.

@unusualevent
Copy link
Author

I'm still getting weird SIGABRT errors if I'm making a new client for each of the goroutines.

is there any way to debug the problem?

@unusualevent
Copy link
Author

looks like I can get a SIGABRT even without using process/embed

@cretz
Copy link
Owner

cretz commented Aug 11, 2023

I don't work on this library much anymore. I think you'll have to debug why the tor process gives that.

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

2 participants