Does glib hash table support multi thread. Is it thread safe hash table.

2010-09-20 Thread Qingpeng Niu
Hi #pragma omp parallel for private(i) shared(pdt_a) for(i=0;ipsize;i++) pdt_a[i]= g_hash_table_new(g_str_hash, compare_strings); It gives the following errors. Somebody can help me out of here. How do i make this hashtable thread safe? GLib-ERROR **: gmem.c:154: failed

Re: Does glib hash table support multi thread. Is it thread safe hash table.

2010-09-20 Thread Lex Trotman
On 21 September 2010 12:20, Qingpeng Niu niuqingp...@gmail.com wrote: Hi #pragma omp parallel for private(i) shared(pdt_a)         for(i=0;ipsize;i++)                 pdt_a[i]= g_hash_table_new(g_str_hash, compare_strings); It gives the following errors. Somebody can help me out of here. How

Re: Does glib hash table support multi thread. Is it thread safe hash table.

2010-09-20 Thread Qingpeng Niu
hi Thank you for replying. I do not call that function. You mean in main thread call that function? Could you give me some simple example? I see this function has some thread safe explaination. g_hash_table_ref () Atomically increments the reference count of *hash_table* by one. This function is

Re: Does glib hash table support multi thread. Is it thread safe hash table.

2010-09-20 Thread Lex Trotman
On 21 September 2010 13:30, Qingpeng Niu niuqingp...@gmail.com wrote: hi Thank you for replying. I do not call that function. You mean in main thread call that function? Read http://library.gnome.org/devel/glib/stable/glib-Threads.html Cheers Lex Could you give me some simple example?