2

When working on a small ZeroVM application that will run on ZeroCloud (that is, the ZeroVM integration with Swift), and trying to import the multiprocessing module, I get an error:

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    import multiprocessing
  File "/lib/python2.7/multiprocessing/__init__.py", line 65, in <module>
    from multiprocessing.util import SUBDEBUG, SUBWARNING
  File "/lib/python2.7/multiprocessing/util.py", line 38, in <module>
    import threading        # we want threading to install it's
  File "/lib/python2.7/threading.py", line 6, in <module>
    import thread
ImportError: No module named thread

Why is that?

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229

1 Answers1

2

There is currently no support for threading or multiprocessing in ZeroVM. The Python status document lists both modules as unsupported.

The ZeroVM platform is a single process, single threaded environment. However, there is a pthreads port available. Instead of normal premeptive multithreading, this port uses cooperative multitasking instead. It might be possible to use this to enable some form of threading in the ZeroVM Python port.

Martin Geisler
  • 72,968
  • 25
  • 171
  • 229