##// END OF EJS Templates
Updating docs to reflect new examples....
Updating docs to reflect new examples. * Changed literalinclude paths to point to /examples. * Removed parallel options demo from parallel_demos.txt as it is now a notebook. Eventually we will find a way to integrate notebooks with the sphinx docs, but that is beyond the scope of this branch.

File last commit:

r9190:20a102a5
r9200:daa73a3d
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": " "
}
]
}
]
}