kr_Bahadr
February 23rd, 2015, 08:49 PM
Hello forum,
I want to understand multithreading process in gtk+. I searched on net and I learn that, gtk main is automatically lock global mutex. And at the and of main loop mutex become unlocked. So I can't analyze following condition :
when I call g_timeout_add in the main loop, what is the program's behavior.
I think when gtk_main unlocked the mutex, timeout function lock mutex and then timeout function is executed. When timeout function is finish, gtk main loop executed again. I want to ask that, I am wrong, or I am right ?
and then I have another question :
in this case, If I create a thread in g_timeout_add(), what is the program behavior ? I am no idea about this condition ?
and the last question (if you still read, thanks a lot :) )
I learn that g_timeout_add lock global mutex automaticaly, when I create a tread in timeout func, and try to lock mutex with gdk_treads_enter in created task, what is the mutex condition ?
Please help me my friends :)
thanks a lot :)
I want to understand multithreading process in gtk+. I searched on net and I learn that, gtk main is automatically lock global mutex. And at the and of main loop mutex become unlocked. So I can't analyze following condition :
when I call g_timeout_add in the main loop, what is the program's behavior.
I think when gtk_main unlocked the mutex, timeout function lock mutex and then timeout function is executed. When timeout function is finish, gtk main loop executed again. I want to ask that, I am wrong, or I am right ?
and then I have another question :
in this case, If I create a thread in g_timeout_add(), what is the program behavior ? I am no idea about this condition ?
and the last question (if you still read, thanks a lot :) )
I learn that g_timeout_add lock global mutex automaticaly, when I create a tread in timeout func, and try to lock mutex with gdk_treads_enter in created task, what is the mutex condition ?
Please help me my friends :)
thanks a lot :)