You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am wondering how to properly use redb in multithreaded, async IO code (using Tokio). Can someone clarify the following?
Where and how many Database variables do I have to create? Do I create one in main and wrap it into an Arc<Mutex<..>> and clone it between threads? [Edit: I have just seen that Database and ReadTransactions are Send and Sync and WriteTransaction is Sync - I'll try to work from that and just share everything :-) ... but still it would be nice the hear what others think]
What should be shared across threads and what should not be shared? I saw the multithreaded benchmark, but that only works when I have control over what happens on which thread - in async IO code, that kind of control is not possible and I wonder how to integrate redb into async programs properly.
Any ideas or pointers?
Jan
The text was updated successfully, but these errors were encountered:
I am wondering how to properly use redb in multithreaded, async IO code (using Tokio). Can someone clarify the following?
Where and how many Database variables do I have to create? Do I create one in main and wrap it into an Arc<Mutex<..>> and clone it between threads? [Edit: I have just seen that Database and ReadTransactions are Send and Sync and WriteTransaction is Sync - I'll try to work from that and just share everything :-) ... but still it would be nice the hear what others think]
What should be shared across threads and what should not be shared? I saw the multithreaded benchmark, but that only works when I have control over what happens on which thread - in async IO code, that kind of control is not possible and I wonder how to integrate redb into async programs properly.
Any ideas or pointers?
Jan
The text was updated successfully, but these errors were encountered: