Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
[C#] Threading
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Yadz" data-source="post: 363598" data-attributes="member: 56975"><p>So I'm new to C# and were wondering: Whats the best way to keep a thread alive in C#? For example if I want to constantly check if a car got less than 0 litres fuel (bad example), how should I do it in a thread? The only way I can think of is using is a while(true) loop with an if statement in it (in this case). </p><p>Also could the while(true) loop affect the application in a bad way? What if I got a while(true) loop in a thread with 50 if statements in it? Is it bad to do that?</p></blockquote><p></p>
[QUOTE="Yadz, post: 363598, member: 56975"] So I'm new to C# and were wondering: Whats the best way to keep a thread alive in C#? For example if I want to constantly check if a car got less than 0 litres fuel (bad example), how should I do it in a thread? The only way I can think of is using is a while(true) loop with an if statement in it (in this case). Also could the while(true) loop affect the application in a bad way? What if I got a while(true) loop in a thread with 50 if statements in it? Is it bad to do that? [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
[C#] Threading
Top