A Seg, 2004-03-01 �s 19:16, Christian Robottom Reis escreveu:

> I agree, and it does sound like a bug to me. Gustavo seems to be
> concerned about [unconditionally?] locking around the Py_DECREF() call,
> which in this case suggests to me the best path is to open a bug report
> in bugzilla.gnome.org. If you could include your testcase and analysis
> above, it would be a great description for the bug, already.
> 
> For reference, the mailing list thread for the issue is at:
> 
>     http://www.mail-archive.com/[EMAIL PROTECTED]/msg07726.html

  Yes, it's best to open a bug report.  I promise to look at it again
when I get more free time (next weekend, if not sooner).  Right now I
just can't spend much time on this.  And this does need to carefully
studied.  We can't just throw a mutex on every threading problem,
otherwise performance will poor in the end.

> 
> > >   However, this patch is not a good idea at all, as it uses a couple
> > of
> > > very expensive mutex lock/unlock operations for each object freed.  We
> > > can avoid this, and following the gtk+ approach, if the programmer is
> > > responsible for not sharing a single GObject between two threads.  Or
> > if
> > > the programmer wishes to do so, he should use explicit locking around
> > > operations on such objects.
> 
> The issue is: what operation is Graham invoking that *could* be
> protected by locking?
> 
> > There aren't any threads in the example because I thought that would
> > make it harder to follow and they're not needed to exhibit the problem,
> > though the call to gtk.init_threads is needed to cause pygtk to attempt
> > to acquire & free the interpreter lock.
> 
> This is the part that confuses me. I asked before: if you do
> threads_init() at the beginning of the program (before creating the

> ListStore) do things work as expected? What does threads_init() do that
> makes Py_DECREF an operation that requires thread locking?

  The answer to that question is half the solution, I suspect. :)

> 
> I wonder if a potential solution is to lock around the Py_DECREF()
> *when* threading is enabled?

  Well, I really don't know.  Python threading is not exactly my area of
expertise O:-)

  Regards.

-- 
Gustavo J. A. M. Carneiro
<[EMAIL PROTECTED]> <[EMAIL PROTECTED]>

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to