Jump to content

  • Log In with Google      Sign In   
  • Create Account

D3D11_CREATE_DEVICE_SINGLETHREADED , Should i?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Rexxaw(Forgrim's mate)   Members   -  Reputation: 121

Like
0Likes
Like

Posted 19 April 2012 - 01:12 PM

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.

Sponsor:

#2 CornyKorn   Members   -  Reputation: 476

Like
0Likes
Like

Posted 19 April 2012 - 02:04 PM

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;
}


#3 MJP   Moderators   -  Reputation: 11774

Like
0Likes
Like

Posted 19 April 2012 - 02:29 PM

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.

#4 Rexxaw(Forgrim's mate)   Members   -  Reputation: 121

Like
0Likes
Like

Posted 20 April 2012 - 12:01 AM

Thank's, just what i wanted to hear :) Now i have got my first directx app up and running. Drinks on me.

#5 Bacterius   Crossbones+   -  Reputation: 9286

Like
0Likes
Like

Posted 20 April 2012 - 12:29 AM

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.

The slowsort algorithm is a perfect illustration of the multiply and surrender paradigm, which is perhaps the single most important paradigm in the development of reluctant algorithms. The basic multiply and surrender strategy consists in replacing the problem at hand by two or more subproblems, each slightly simpler than the original, and continue multiplying subproblems and subsubproblems recursively in this fashion as long as possible. At some point the subproblems will all become so simple that their solution can no longer be postponed, and we will have to surrender. Experience shows that, in most cases, by the time this point is reached the total work will be substantially higher than what could have been wasted by a more direct approach.

 

- Pessimal Algorithms and Simplexity Analysis





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS