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

多线程问题 #54

Closed
zhly0 opened this issue Oct 28, 2017 · 2 comments
Closed

多线程问题 #54

zhly0 opened this issue Oct 28, 2017 · 2 comments

Comments

@zhly0
Copy link

zhly0 commented Oct 28, 2017

你好,问下在mini-caffe中common.hpp中有Caffe这个类,为什么找了半天没看到在哪里有用啊,还有这个mini-caffe的多线程是怎么样的啊?就是在不同的线程中调用用CaffeNetCreate初始化了的net会怎么样,会和BVLC/caffe#4595 中一样吗?

@luoyetx
Copy link
Owner

luoyetx commented Oct 30, 2017

Caffe 这个类是 thread local 的单例,是 global context,代码其他地方有用到,比如这里判断运行环境是 cpu 还是 gpu。不同线程创建 net 对象没有问题,net 对象本身并不是线程安全的,不能创建一个对象然后在多个线程里去调用 net 对象的方法。

@zhly0
Copy link
Author

zhly0 commented Oct 30, 2017

明白了,多谢!

@zhly0 zhly0 closed this as completed Oct 30, 2017
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