I want to have a concurrent hash map as a member of structure. I am doing it as below:
typedef concurrent_hash_map<int, int> Acreaders;
struct node{
void *obj;
int size; // see if required
Acreaders acrdr;
};
So that i should be able to access to insert into the hash table as:
Acreaders::accessor a;
struct node *n;
n = (struct node *)malloc(sizeof(struct node));
(n->acrdr).insert(a, 5);
Although the program compiles correctly, it leads to segmentation fault.
What might be the problem? Thanks..