【发布时间】:2015-10-18 14:41:36
【问题描述】:
what kind of thread or how many thread should I use, if I doing the following?
我的问题是这样的:
线程 1 执行该过程:只要 line_1(base_file 的第一行)中的姓氏可以在 row_1-row_end(huge_file 中的每一行)中匹配,则在 row_1-row_end 中写入 line_1 和几行(如果匹配)。
线程 2 做这个过程:只要 line_2(base_file 的第一行)中的姓氏可以在 row_1-row_end(huge_file 中的每一行)中匹配,如果匹配,则在 row_1-row_end 中写入 line_2 和几行。
线程 3 执行该过程:只要 line_3(base_file 的第一行)中的姓氏可以在 row_1-row_end(huge_file 中的每一行)中匹配,如果匹配,则在 row_1-row_end 中写入 line_3 和几行。
........
线程 100 执行该过程:只要 line_100(base_file 的第一行)中的姓氏可以在 row_1-row_end(huge_file 中的每一行)中匹配,则在 row_1-row_end 中写入 line_100 和几行(如果匹配)。
这 100 个或更多线程都同时启动。这可能吗?
【问题讨论】:
标签: multithreading python-3.x threadpool