##// END OF EJS Templates
Update deepreload to use a rewritten knee.py. Fixes dreload(numpy)....
Update deepreload to use a rewritten knee.py. Fixes dreload(numpy). knee.py, a Python re-implementation of hierarchical module import was removed from the standard library because it no longer functioned properly. deepreload.py is little more than a hacked version of knee.py which overrides __builtin__.__import__ to ensure that each module is re-imported once (before just referring to sys.modules as usual). In addition, `os.path` was added to the default excluded modules, since somehow it has an entry in sys.modules without `os' being a package.

File last commit:

r5885:cf991e07
r6531:c0ad0135
Show More
gilsleep.ipynb
55 lines | 1.3 KiB | text/plain | TextLexer
MinRK
add test notebook and script for #1260 (GIL-related heartbeat failures)...
r5885 {
"metadata": {
"name": "gilsleep"
},
"nbformat": 2,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
"source": [
"Holding the GIL for too long could disrupt the heartbeat due to non-copying sends.",
"",
"The following cell repeatedly calls a function that holds the GIL for five seconds.",
"",
"The heartbeat will fail after a few iterations prior to fixing Issue [#1260](https://github.com/ipython/ipython/issues/1260)."
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import sys",
"import time",
"",
"from cython import inline",
"",
"def gilsleep(t):",
" \"\"\"gil-holding sleep with cython.inline\"\"\"",
" code = '\\n'.join([",
" 'from posix cimport unistd',",
" 'unistd.sleep(t)',",
" ])",
" while True:",
" inline(code, quiet=True, t=t)",
" print time.time()",
" sys.stdout.flush() # this is important",
"",
"gilsleep(5)"
],
"language": "python",
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "code",
"collapsed": true,
"input": [],
"language": "python",
"outputs": [],
"prompt_number": " "
}
]
}
]
}