Re: [Python-Dev] tiny optimization in ceval mainloop
by Skip Montanaro other posts by this author
Aug 30 2002 1:59PM messages near this date
RE: [Python-Dev] tiny optimization in ceval mainloop
|
Re: [Python-Dev] tiny optimization in ceval mainloop
Skip> Any time C code would want to read or update ticker, it would have
Skip> the GIL, right?
Jack> Not if the idea that lead to this thread (clearing ticker if
Jack> something is put in things_to_do) is implemented, because we may
Jack> be in an interrupt routine at the time we fiddle things_to_do.
Jack> And I don't think we can be sure that even clearing is guaranteed
Jack> to work (if another thread is halfway a load-decrement-store
Jack> sequence the clear could be lost).
Hmm... I guess you lost me. The code that fiddles the ticker in ceval.c
clearly operates while the GIL is held. I think the code in sysmodule.c
that updates the checkinterval works under that assumption as well. The
other ticker in longobject.c I'm not so sure about.
The patch I submitted doesn't implement the ticker clear that Jeremy
originally suggested. It just pulls the ticker and the checkinterval out of
the thread state and makes them two globals. They are both manipulated in
otherwise the same way.
Skip
_______________________________________________
Python-Dev mailing list
Python-Dev@[...].org
http://mail.python.org/mailman/listinfo/python-dev
Thread:
Jeremy Hylton
Guido van Rossum
Greg Ewing
Skip Montanaro
Steve Holden
Steve Holden
Jeremy Hylton
Jack Jansen
Tim Peters
Guido van Rossum
Skip Montanaro
Tim Peters
Jack Jansen
Tim Peters
Jack Jansen
Guido van Rossum
Tim Peters
Skip Montanaro
Skip Montanaro
Guido van Rossum
Skip Montanaro
Guido van Rossum
Jeremy Hylton
Guido van Rossum
Tim Peters
|