简体   繁体   English

运行两个python进程

[英]Running two python processes

I am running two python codes edited by two different text editors (Eclipse and Spyder), and from task manager I saw two python.exe processes. 我正在运行由两个不同的文本编辑器(Eclipse和Spyder)编辑的两个python代码,并且从任务管理器我看到了两个python.exe进程。 Will these two processes interfere with each other? 这两个过程会相互干扰吗? I am worried because I used almost the same set of variable names across these two scripts and both codes are working on the same data input with very similar data structure. 我很担心,因为我在这两个脚本中使用了几乎相同的变量名称集,并且这两个代码都在处理具有非常相似数据结构的相同数据输入。

The processes know nothing about each other. 这些过程对彼此一无所知。

It wouldn't matter if they were identical or not. 它们是否相同无关紧要。 Each process is allocated resources by the OS, so each process has its own resources, and they will not overlap. 每个进程都由操作系统分配资源,因此每个进程都有自己的资源,并且它们不会重叠。 In fact, it is very common to use multiple similar Python processes to do multiprocessing when you have processing that can be done in parallel and logically allocated per process. 实际上,当您具有可以并行完成并按逻辑分配每个进程的处理时,使用多个类似的Python进程进行多处理是很常见的。

Unless they are both using a shared resource like a file, you have nothing to worry about. 除非他们都使用像文件这样的共享资源,否则您无需担心。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM