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

Allowing concurrent read access #27

Open
NathanWolf opened this issue Feb 1, 2011 · 2 comments
Open

Allowing concurrent read access #27

NathanWolf opened this issue Feb 1, 2011 · 2 comments

Comments

@NathanWolf
Copy link
Owner

Persistence needs to use a read lock and a write lock to make access thread safe.

Any number of threads may read at one time (do I need to switch to concurrent hashmaps for this to be safe? I don't think so...), but only one thread may write at a time, and no thread may read while another is writing.

Over-simplified, but I think that should cover it.

@NathanWolf
Copy link
Owner Author

Hm, this needs more thought, but I'm downgrading it's "bug" status.

Persistence is, and has been, thread safe- I just want to optimize it somehow to allow concurrent reading.

@NathanWolf
Copy link
Owner Author

Hm- this still bears investigation. I don't think I'm using the read/write lock objects correctly, possibly at all- I think I'm just super locking everybody out of everything if anyone's doing anything, basically.

Not really performant, but I guess it's the safest thing for now, til I have time to get this truly sorted.

I think all I need is a write lock flag that I manage myself, and then an actual synchronized write lock- but I'm really going to need to dig into this, look at the code, make sure- see if I need to be using ConcurrentHashMaps anywhere I need to, etc.

It's a pretty big deal, so I'm going to just keep things safe for now and demote this issue.

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

No branches or pull requests

1 participant