-
Notifications
You must be signed in to change notification settings - Fork 916
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
[QST] Is there any plan to support insert unused_key in concurrent_unordered_map? #14896
Comments
Hi @OliverLPH, thanks for the question. We are phasing out these classes from cudf in favor of https://github.com/NVIDIA/cuCollections/. @PointKernel may be able to answer your question, if it is relevant to cuCollections. |
@OliverLPH The best solution is to choose a value that will be never used in your case as the unused key (or "sentinel"). Would Another option is to remap sentinel to a different value to avoid conflicts, e.g. cudf/cpp/src/join/join_common_utils.cuh Lines 34 to 45 in 821f4de
Just FYI, |
@PointKernel Thanks for your prompt reply. Thank you. |
It's not a corner case but more of an implementation choice. We chose to use a sentinel value instead of an additional bitmask to denote empty slots since the latter requires extra memory space. Then the downside or "inconvenience" is that any insertions against sentinel value are undefined behavior. If it's impossible to find a sentinel in your case, |
What is your question?
concurrent_unordered_map need set unused_key
when construct it. And unused_key was set to
std::numeric_limits<key_type>::max()
by default. However, there is a possibility that the inserted key may be equal to the unused_key in my scenarios, which might potentially cause the program crash.I just wondering is there any plans to support unused_key insert and find? Thanks for your valuable work.
The text was updated successfully, but these errors were encountered: