is GtkRadioButton thread safe? how do I make sure my similar widget is also thread safe?



Hi.

Looking at the code of GtkRadioButton, I have to question whether it's
thread safe.  I don't use threads (yet) in my application...  and
there's a good chance I won't at all, and I don't really even know how
they work.  (on Linux are they implemented with help from the clone()
system call?)

I'm wondering this because I see some operations being performed on a
GSlist in the widget's code, and I don't see any locking taking place.
It seems dangerous because it's conceivable that two different threads
could be running operations on two different RadioButtons in the same
group and cause the GSList to become inconsistent.

I just finished making a widget class that's similar in many ways to the
GtkRadioButton.  Mine also performs operations on a GSlist that is
shared among many widgets of the same type and doesn't do any locking.
I guess my widget is probably just as thread safe as the GtkRadioButton,
but I don't now how threads work so I'm not sure.

Any pointers are appreciated.  Thank you!

- Ben



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]