Jump to content
  • Advertisement
Sign in to follow this  
Yoyoyoyo

D3D11_CREATE_DEVICE_SINGLETHREADED , Should i?

This topic is 2372 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

I know nothing of threading. If i were to use this method, would it be safe? Or does it require careful design and coding to ensure that the app remains single -threaded?

Thanks.

Share this post


Link to post
Share on other sites
Advertisement

I know nothing of threading. If i were to use this method, would it be safe? Or does it require careful design and coding to ensure that the app remains single -threaded?

Thanks.


Short answer is that a basic application is single threaded, so yes it will be safe. You don't get into threading unless you create additional threads. Something like this hello world is considered single threaded.

int main( int argc, char* argv[] )
{
printf("Hello, world!\n");

return 0;
}

Share this post


Link to post
Share on other sites
You'd have to go out of your way to touch the D3D device from multiple threads, so yes it should be safe to use that flag.

Share this post


Link to post
Share on other sites
Just for information, you don't actually *need* this flag. It just removes threadsafe checks which can improve performance by a tiny margin, but in general the difference is negligible. Basically, if you don't have this flag, you can use both singlethreaded and multithreaded code, but if you have it you may only use singlethreaded code in exchange for a bit more performance.

Note that as MJP says, using the D3D device from more than one thread isn't done by accident but rather by design, so in general you'd know if you needed this flag or not. I prefer not to use it personally, as I'm quite forgetful and the difference in performance is so small.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!