Stackless python and microthreading



Yes, I know that python scripts in VC use the stackless python implementation. Stackless allows micro threading and I guess each component containing a python script use its own thread.

However, is it possible to use the stackless microthreading inside a component? The python editor doesn’t support direct import of stackless. I could implement stackless via site-packages, but I assume that would lead to unpredictable behavior?




I don’t have direct answer to your question, but maybe I can still help. Could you please describe your use case?

  1. Create a new component.
  2. Add a Block feature as a visual for finding the component.
  3. Add a Python Script behavior.
  4. In the script editor, add the following and then compile.
import threading

def hello():
print “hello world”

t = threading.Timer(10.0,hello)

After the timer runs out, what happens?

The Application crash…

1 Like