Should I use Threads or multiple processess?

时间:2016-07-11 22:55:58

标签: python multithreading multiprocessing

I wanted to get some help with an application... Currently I have a script that saves certain information to a database table, well call this table "x". I have another script that gets and saves other info to a different database table, well call this one "y". I also have a script that runs formulas on the information found in table y and I have another script that opens the link found in table x and saves certain information into table "z".

The problem I have is that the first script doesn't end, and neither does the third script. So I know now that I need to have either threads or multiple processes running but which one do I choose?

Script 1 accesses table W & X Script 2 accesses table X & Y Script 3 accesses table Y Script 4 accesses table Z

Can you please give me some guidance on how to proceed?

1 个答案:

答案 0 :(得分:0)

根据Harp对其原始帖子的第二条评论(在之后发布我怀疑你现在同意我进程< / em>可能在这里被称为 - 基于这个新提供的信息。

然而,我发现自己质疑在这里可能找到多少“真正有效的并发”。这对我来说听起来像作业:一个“脚本1”(带有子脚本1.1,1.2 等),,它准备一个输入文件,然后交付到“脚本2”特别是因为“脚本2”对于所做的外部网站完全赞同,我还不清楚“多线程”的复杂性在这里是真正合理的。 / p>