Jump to content
  • Advertisement
Sign in to follow this  
noatom

In what state is a thread when you create it?

This topic is 1669 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So after you create the thread you can either join it, and wait for it to complete, or detach it, and let it run on its own. But what happens when you do neither? What is the initial state in which a thread gets created? (I'm using the thread feature in c++11)

Share this post


Link to post
Share on other sites
Advertisement
This overview seems to cover your question:

An initialized thread object represents an active thread of execution; Such a thread object is joinable, and has a unique thread id.

A default-constructed (non-initialized) thread object is not joinable, and its thread id is common for all non-joinable threads.

A joinable thread becomes not joinable if moved from, or if either join or detach are called on them.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!