-
Notifications
You must be signed in to change notification settings - Fork 351
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
thread safety #263
Comments
csa_sada is (as far as I remember) the only class which is not thread-safe in the read-only scenario, since it stores some decoded integers in a cache. We will definitely change this in the very near future. |
For a quick fix, you would have to replace the buffer m_psi_buf by a local variable in the rank_bwt function: |
I'm having thread-safety problems that superficially (in gdb) appear to be related to a
It doesn't seem like this could this be related to csa_sada, so I'm confused. It could be something in my application, but I haven't yet found anything and wanted to confirm it's not a limitation of sdsl-lite. |
I can avoid this error by placing a mutex lock on the code that calls select on the wt. |
Sorry, you are right; select on |
Wow, thanks! This had me stumped. I'll make a patch unless you beat me to it. |
Am I right in assuming that putting things local to the select procedure would be a problem for larger alphabets? I'm wondering if it's worth working around this by establishing a select support per thread. |
No, the size of the vector is log(alphabet size). So it should be not a problem ;) |
Cool, I've got a patch--- testing now. |
I'm also implementing the change in wm_int.hpp and wt_pc.hpp. |
Whoops, I'll leave wt_pc.hpp alone, that one's configurable. |
great |
Per caching in sdsl-lite: simongog/sdsl-lite#263. This allows the calling context to decide whether or not to use the add_paths_to_graph functionality that is often not necessary and is also not thread safe.
This is also not threadsafe, so we will have to pass through a mutex lock in xg. See simongog/sdsl-lite#263
I've run back into thread safety problems, presumably related to caching in select. Is there a way to configure sdsl-lite to not use caching? |
what select structure? |
Hi Erik, could you please open a pull request with your changes to wm_int and wt_int? Simon ps: We have a thread-safe redesign of the other non-thread safe part (csa_sada) in another branch, which will be merged in a few weeks. |
@simongog have you pulled in the thread safe branch of csa_sada? I'm re-making the appropriate changes for wm_int and wt_int. |
The referenced pull request includes roughly the same change that I had made before. Are there other aspects of the library which are still not thread safe? |
@ekg, thanks for the pull request. The branch which makes csa_sada thread safe is not yet merged. We did a major redesign of |
@simongog thanks for merging the pull request so quickly! This fix lets me remove the lock on the one non-threadsafe part of the API that I'm targeting. I don't need csa_sada, but I totally support making sdsl-lite thread safe for non-destructive operations on its data structures. |
Can you guys provide an update on the status of csa_sada's thread safety? I've been playing with it lately and the data structure seems to be locked when multiple threads are accessing it. |
Uh oh, I thought this had been resolved. |
Did more investigation and turns out something else was the source of problem. My bad. Please delete this if necessary. Thanks. |
I'm learning through trial and error that not all classes in sdsl-lite are thread safe (for instance). Is there documentation about what features of sdsl-lite are thread safe? I have an application that relies on read-only thread-safe succinct data structures.
The text was updated successfully, but these errors were encountered: