Skip to content
This repository has been archived by the owner on Nov 3, 2019. It is now read-only.

Wait only on read Vars #3

Closed
anacrolix opened this issue Oct 22, 2019 · 4 comments
Closed

Wait only on read Vars #3

anacrolix opened this issue Oct 22, 2019 · 4 comments

Comments

@anacrolix
Copy link
Contributor

I noticed that Tx.verify waits on a global condition. Have you considered installing some synchronisation primitive on to each Var that's read for a Tx, and when committing a write, signalling all waiters on only those Vars that are written? I imagine the overhead may be a larger for toy examples, but it might be possible to minimize overhead by lazily creating and reusing the primitive when Txs have to wait, and using and reusing slices for the waiters on the Vars (they're quite efficient). There's currently no benchmark that would demonstrate any speed-up for a change like this if it's plausible.

@lukechampine
Copy link
Owner

To be honest, I consider this package to be mostly "for fun" and not intended for serious use. It hasn't been touched in many years at this point. If you're interested in developing it further, I'll happily post a deprecation notice and link to your fork. Regardless, I suppose I should put some sort of disclaimer in the README.

@anacrolix
Copy link
Contributor Author

I have implemented this here: anacrolix/stm@master...anacrolix:var-conds. I also have restructured the code, and added some tests here: https://github.com/anacrolix/stm.

@anacrolix
Copy link
Contributor Author

@lukechampine I have started developing this further. I've created some integrations with context, a set of persistent data structures, transaction return values, and a rate limiter to supplement the core. If you'd like to deprecate in favour of my implementation I think it might be appropriate now. Let me know your thoughts.

@lukechampine
Copy link
Owner

Cool -- passing the torch to you now :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants