summaryrefslogtreecommitdiffstatshomepage
path: root/py/mpconfig.h
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2017-02-06 10:50:43 +1100
committerDamien George <damien.p.george@gmail.com>2017-02-15 11:28:15 +1100
commitf6c22a06797735e4a65a91491d8373ba951a798b (patch)
tree3f36bbb80ccbc5c73d8ce0dd4e086738e68fccd9 /py/mpconfig.h
parent234f07f16cc845128658cc0b39ac681cae5a8fba (diff)
downloadmicropython-f6c22a06797735e4a65a91491d8373ba951a798b.tar.gz
micropython-f6c22a06797735e4a65a91491d8373ba951a798b.zip
py/vm: Add MICROPY_PY_THREAD_GIL_VM_DIVISOR option.
This improves efficiency of GIL release within the VM, by only doing the release after a fixed number of jump-opcodes have executed in the current thread.
Diffstat (limited to 'py/mpconfig.h')
-rw-r--r--py/mpconfig.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/py/mpconfig.h b/py/mpconfig.h
index 093625a461..1b47d822f1 100644
--- a/py/mpconfig.h
+++ b/py/mpconfig.h
@@ -949,6 +949,12 @@ typedef double mp_float_t;
#define MICROPY_PY_THREAD_GIL (MICROPY_PY_THREAD)
#endif
+// Number of VM jump-loops to do before releasing the GIL.
+// Set this to 0 to disable the divisor.
+#ifndef MICROPY_PY_THREAD_GIL_VM_DIVISOR
+#define MICROPY_PY_THREAD_GIL_VM_DIVISOR (32)
+#endif
+
// Extended modules
#ifndef MICROPY_PY_UCTYPES