在 Windows 中复制 fork() 的最佳方法是什么? [英] What's the best way to duplicate fork() in windows?

查看:27
本文介绍了在 Windows 中复制 fork() 的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 Python 实现一些逻辑,以允许我在 Windows 上使用 fork() 系统调用在 Linux 上重现我在 Linux 上的功能?

How do I implement some logic that will allow me to reproduce on Windows the functionality that I have on Linux with the fork() system call, using Python?

我专门尝试在 SAPI Com 组件上执行一个方法,同时在主线程中继续执行其他逻辑而不阻塞或等待.

I'm specifically trying to execute a method on the SAPI Com component, while continuing the other logic in the main thread without blocking or waiting.

推荐答案

使用 python 多处理模块 可以在任何地方使用.

Use the python multiprocessing module which will work everywhere.

这是一篇 IBM developerWords 文章,展示了如何转换从 os.fork() 到多处理模块.

Here is a IBM developerWords article that shows how to convert from os.fork() to the multiprocessing module.

这篇关于在 Windows 中复制 fork() 的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆