Nick Coghlan added the comment:

https://github.com/ncoghlan/cpython/pull/2/files now adds a DEFER_PENDING_UNTIL 
opcode that relies on the jump offset calculation machinery to decide how long 
pending call processing should be deferred.

Right now, the test case is also emulating the "skip pending call" logic based 
on a frame attribute, but I'm going to try to replace that with a suitable call 
to _testcapi._pending_threadfunc, which would avoid the need to expose those 
details on the frame, and ensure that we're testing the logic that actually 
matters.

However, the good news is that:

1. the patch is complete enough that I think it demonstrates that this approach 
is potentially viable
2. because it only suspends pending call process in the *current* frame, it's 
safe to cross boundaries that may call arbitrary Python code (this turns out to 
be important for the async with case)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29988>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to