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

为什么encode里用queue来实现 #27

Open
BucherLi opened this issue Jun 1, 2019 · 3 comments
Open

为什么encode里用queue来实现 #27

BucherLi opened this issue Jun 1, 2019 · 3 comments

Comments

@BucherLi
Copy link

BucherLi commented Jun 1, 2019

如题 为什么用在encode里用queue来异步获取句向量呢?而且我看里面设置的queue的长度为1,如果有并发的时候 会不会导致丢失数据呢

@terrifyzhao
Copy link
Owner

@BucherLi estimator执行predict每次都会去加载图,用queue能避免这个问题

@BucherLi
Copy link
Author

BucherLi commented Jun 6, 2019

estimator执行predict每次都会去加载图,用queue能避免这个问题

并发安全吗,多线程同时调用encode的时候。会不会造成数据丢失,是不是得给queue加锁

@BucherLi
Copy link
Author

@terrifyzhao 并发安全吗,多线程同时调用encode的时候。会不会造成数据丢失,是不是得给queue加锁

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

2 participants