cython で以下の動作を再現する最良の方法は何ですか (Python とやり取りする必要はありません)。新しいプロセスに渡される関数が関数であると仮定しcdef
ます。
import time
from multiprocessing import Process
def func1(n):
while True:
# do some work (different from func2)
time.sleep(n)
def func2(n):
while True:
# do some other work (different from func1)
time.sleep(n)
p1 = Process(target=func1, args=(1,))
p1.start()
p2 = Process(target=func2, args=(1,))
p2.start()
Cython を使用して (Python と対話せずに) 別のプロセスで関数を実行する方法は?