MCPcopy Create free account
hub / github.com/pydata/numexpr / PySet_num_threads

Function PySet_num_threads

numexpr3/module.cpp:266–276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264PyDoc_STRVAR(SetNumThreads__doc__,
265"Sets a maximum number of threads to be used in operations. Returns old value.\n");
266static PyObject*
267PySet_num_threads(PyObject *self, PyObject *args) {
268 int n_threads_new, n_threads_old;
269 if (!PyArg_ParseTuple(args, "i", &n_threads_new))
270 return NULL;
271
272 pthread_mutex_lock(&gs.global_mutex);
273 n_threads_old = numexpr_set_nthreads(n_threads_new);
274 pthread_mutex_unlock(&gs.global_mutex);
275 return Py_BuildValue("i", n_threads_old);
276}
277
278PyDoc_STRVAR(GetNumThreads__doc__,
279"Gets a maximum number of threads to be used in operations.\n");

Callers

nothing calls this directly

Calls 1

numexpr_set_nthreadsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…