-
Notifications
You must be signed in to change notification settings - Fork 372
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
Switch total_consistency_lock
to a Send
RwLock
variant
#2003
Comments
Yea, so this is really gonna be a pain. We're gonna have to really bend over backwards for this, but I think it'll be pretty doable. Basically just implementing our own RwLock using atomics and CVs is CS201 kinda stuff, and will get us Send/Sync, at least insofar as the "inner type" on the mutex is |
Sounds good, I intend to pick this up after the 0.0.114 release. |
When you do this, can you look into ripping out all the |
+1 for removing Since we're coming from wasm, that's fine for us for now. I believe at one point I tried to do a bunch of |
I'm not sure about the background processor (as the async version doesn't work anyways currently), but I'm pretty sure we can't remove |
Yea, its actually really annoying Rust doesn't let us make some kind of optionally-Sync bound. We'd need a duplicate method that avoids the bounds or a feature to make them optional, if we could do that with relatively low LoC we should, though. |
When trying to switch to async background processing/event handling in LDK Node, I stumbled across the fact that tokio won't let me spawn a task for the
process_events_async
, as the we currently try to hold thetotal_consistency_lock
over.await
boundaries:rust-lightning/lightning/src/ln/channelmanager.rs
Lines 5242 to 5259 in e1208bf
This is an issue since
RwLockReadGuard
is notSend
:In order to fix this, we need to explore options for replacing the
RwLock
oftotal_consistency_lock
. One option might be taking a suitable dependency such asparking_lot
, another approach would be to implement our ownRwLock
variant that meets the requirements.The text was updated successfully, but these errors were encountered: