Hi,
I am running Pymunk on a RaspberryPi 5.
With the setting not Threaded every thing works as expected.
When trying to use threaded=True, things stop working.
the setting:
```python
self._space = pymunk.Space()
self._space.threaded = True
self._space.threads = 2
```
I am running Raspios-Trixie-armhf-lite
I am Importing these libraries:
```python
import os
import math
import random
import numpy as np
import skimage as ski
import pymunk
from gpiozero import LED, Button
```
i get three variations of errors:
1 - it just freezes and does not show any error (i kill the python process)
2 - Fatal glibc error: pthread_mutex_lock.c:450 (__pthread_mutex_lock_full): assertion failed: e != ESRCH || !robust
3 - Segemntation Fault
Unfortunately dont have any arm devices suitable to test this on. But, what I think is the issue is that the threading comes with NEON support on arm. And the NEON implementation only works with 64bit arm when using doubles and not floats. And by default Pymunk uses doubles since it gives much better precision in the simulation. If Im not mistaken, the RPi5 is 64bit, but your OS is not so this could be the issue?
It is possible to either disable the NEON support or switch to 32bit floats instead of doubles, but it has to be done as compiler flags. And those are not possible to set during the normal installation flow, but require some slight change to the Pymunk setup source code.
I guess that when you install Pymunk its from source wheel and not one of the binary ones. If so it shouldnt be too difficult to test this. Not sure if you want to disable NEON (less speed), or disable double (less precision)?
If you want to try yourself, get the Pymunk source, and in the file `pymunk_extension_build.py` you need to do one of these (if you think its too complicated I guess I can prepare some wheels for you):
```
# Option 1: replace this line
define_macros=[("CP_OVERRIDE_MESSAGE", None)],
# with this to disable doubles:
define_macros=[("CP_OVERRIDE_MESSAGE", None), ("CP_USE_DOUBLES", 0)],
# Option 2: add an extra line after the define_macros like this:
define_macros=[("CP_OVERRIDE_MESSAGE", None)],
undef_macros=["__ARM_NEON__"],
```
then it can be installed.
I should add, Im unsure how much you gain from the threading (or NEON or floats). I haven't really tested this. If you do get it to work with and without one of these it would be interesting to hear how it affected performance.