• Advertisement
Sign in to follow this  

D3D11_CREATE_DEVICE_SINGLETHREADED , Should i?

This topic is 2104 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
Thank's, just what i wanted to hear :) Now i have got my first directx app up and running. Drinks on me.

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