Skip to content

Instantly share code, notes, and snippets.

View stavskal's full-sized avatar

Stavrianos Skalidis stavskal

View GitHub Profile
@stavskal
stavskal / mt.py
Created May 31, 2017 16:07 — forked from gdementen/mt.py
Example of multithreading a numba function by releasing the GIL through ctypes
import ast
from timeit import repeat
import threading
from ctypes import pythonapi, c_void_p
import math
import numpy as np
try:
import numexpr as ne
nthreads = ne.ncores