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

On Thu, Feb 03, 2005 at 06:54:04AM -0500, Paul Davis wrote:
> >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.
> Terrible idea. That should not happen. If it does, you need to
> redesign your program.

I'm sure I understand you because of the following, but to make
absolutely certain...  you mean: locking shared structures from within
generic widget code (such as that defined by the GtkRadioButton) is a
terrible idea.  right?  (don't bother answering this question, unless my
head is really on backwards.)

> Just for completeness: the reason that X Window works this way is that
> any GUI toolkit is faced with a dilemma about thread support:
>     * be thread-safe, but slow down the common case (single-threaded programs)
>     * be thread-unsafe, and create more work for programmers working
>          on multithreaded programs
> X Window chose the latter option. Some other systems (such as the ones
> typically used on Windows) chose the former.

Thank you very much for removing my confusion.  I'll let my simple
widgets continue to be non-thread-safe. 

- Ben

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