Hello,
Im relatively knew to programming and any help is appreciated. My question is this...
I am creating a library that implements a thread-safe hash table.
I am curious how to initialize a lock for each "bucket" of the hash table.
here is the code I have for the initializing part only....
Code:void Hash_Init(int buckets) { int i = 0; hash_buckets = malloc(buckets * sizeof(struct hash_bucket)); g_numOfBuckets = buckets; for (i = 0; i < buckets; i++) { hash_buckets[i].head = NULL; } }