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

Minor issues using m-array.h and m-concurrent.h #40

Closed
mario-tux opened this issue Nov 25, 2018 · 6 comments
Closed

Minor issues using m-array.h and m-concurrent.h #40

mario-tux opened this issue Nov 25, 2018 · 6 comments
Assignees

Comments

@mario-tux
Copy link

Trying to write an ad-hoc benchmark for #39 I spotted few minor issues trying to get a thread-safe array container:

  • there is a const-related warning, example:
ARRAY_DEF(key_list, string_t)
#define M_OPL_key_list_t() ARRAY_OPLIST(key_list, STRING_OPLIST)
CONCURRENT_DEF(key_list_ts, key_list_t)
  • the method _size is not exposed in the concurrent version: I can't get the number of elements in such kind of array.
@P-p-H-d
Copy link
Owner

P-p-H-d commented Nov 25, 2018

Both issues should be fixed in master.

@mario-tux
Copy link
Author

Now I'm getting at runtime an assertion error on the CONCURRENT_DEF point: key_list_ts_read_lock: Assertion out->self == out' failed.`

@P-p-H-d
Copy link
Owner

P-p-H-d commented Nov 25, 2018

Can I have the source of this error to investigate?

@mario-tux
Copy link
Author

@P-p-H-d
Copy link
Owner

P-p-H-d commented Nov 25, 2018

You forget to init keys. You should add in main:

key_list_ts_init(keys);
....
key_list_ts_clear(keys);

@mario-tux
Copy link
Author

Yes: stupid error. I didn't use such container on first runs because of other bug. On the other side it worker on some runs before but I was just lucky (maybe you added further controls on last commits).

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

2 participants