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

Can main thread be vCPU? Or we must new std::thread as vCPU? #493

Open
jiangdongzi opened this issue May 27, 2024 · 2 comments
Open

Can main thread be vCPU? Or we must new std::thread as vCPU? #493

jiangdongzi opened this issue May 27, 2024 · 2 comments

Comments

@jiangdongzi
Copy link

No description provided.

@beef9999
Copy link
Collaborator

yes, main thread can become vCPU, as long as you have called photon::init

However, main thread/vCPU is not included in the WorkPool, even workpool is usually created from the main thread

@Coldwings
Copy link
Collaborator

Actually, any std::thread or pthread that called photon::init or photon::vcpu_init will be treated as a vCPU, so yes, if you initialized photon environment by calling photon::init or photon::vcpu_init, photon will turns it into vCPU.

WorkPool is another utility, is a wrapped tool for creating thread, turns into vCPU ( or make some vCPU joins as a worker), and deploy works.

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

3 participants