# Limit Number of threads in python SimpleITK programatically

**URL:** https://discourse.itk.org/t/limit-number-of-threads-in-python-simpleitk-programatically/2723
**Category:** Beginner Questions
**Created:** [February 14, 2020, 8:19am UTC](https://discourse.itk.org/t/limit-number-of-threads-in-python-simpleitk-programatically/2723 "2020-02-14T08:19:09Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [February 14, 2020, 2:11pm UTC](https://discourse.itk.org/t/limit-number-of-threads-in-python-simpleitk-programatically/2723/2 "2020-02-14T14:11:54Z")

</div>

Hello @reox,

The SimpleITK process object has a method [SetGlobalDefaultNumberOfThreads](https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1ProcessObject.html#a305b43330f9feb26325eadfc30695bd9):

```auto
import SimpleITK as sitk
MAX_THREADS = 3

sitk.ProcessObject.SetGlobalDefaultNumberOfThreads(MAX_THREADS)

```

There’s the matching Get method so that you can find out what is the global default number of threads.

---

_[View the full topic](https://discourse.itk.org/t/limit-number-of-threads-in-python-simpleitk-programatically/2723)._
