Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask #27

Closed
poppindouble opened this issue Aug 6, 2018 · 0 comments
Closed

Ask #27

poppindouble opened this issue Aug 6, 2018 · 0 comments

Comments

@poppindouble
Copy link

笑虎大神你好:
刚接触爬虫这个领域,看了一下你的源代码,觉得设计的很好,我这里有个小小的疑问,你看我理解的对不对。
我的疑问是fetcher,parser,saver多线程之间是怎样相互协调的。
我的理解是在你的ThreadThreadPool里面有_number_dict这个变量,这个变量是所有其他线程共享的,其实相当于semaphore的想法,每次更新都需要lock起来,比如当fetcher获取到了新的url,parser就可以去根据这个信号量的变化进行下一步的工作。
你看我这样理解对吗?
谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant