Click here to Skip to main content
15,443,430 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: while(true) is not fun Pin
trønderen21-Sep-20 4:05
Membertrønderen21-Sep-20 4:05 
GeneralRe: while(true) is not fun Pin
Member 1409260522-Sep-20 21:50
MemberMember 1409260522-Sep-20 21:50 
GeneralOoops. So this should be fun Pin
honey the codewitch20-Sep-20 3:59
mvahoney the codewitch20-Sep-20 3:59 
GeneralRe: Ooops. So this should be fun Pin
OriginalGriff20-Sep-20 4:37
mveOriginalGriff20-Sep-20 4:37 
GeneralRe: Ooops. So this should be fun Pin
Matthew Dennis20-Sep-20 4:40
sysadminMatthew Dennis20-Sep-20 4:40 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 5:04
professionalSander Rossel20-Sep-20 5:04 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:08
mvahoney the codewitch20-Sep-20 6:08 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 6:27
professionalSander Rossel20-Sep-20 6:27 
Alright, how about I optimize that using the faster and lightweight TPL?
Lightweight threads from the threadpool, or, if possible, just time slice and save the overhead from starting up a new thread altogether! Big Grin | :-D
C#
while (true)
{
    Task.Factory.StartNew(() => {
        // Some code here
    });
}
All fixed Roll eyes | :rolleyes:

GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:34
mvahoney the codewitch20-Sep-20 6:34 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 6:38
professionalSander Rossel20-Sep-20 6:38 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:42
mvahoney the codewitch20-Sep-20 6:42 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 6:47
professionalSander Rossel20-Sep-20 6:47 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:49
mvahoney the codewitch20-Sep-20 6:49 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 23:10
professionalSander Rossel20-Sep-20 23:10 
GeneralRe: Ooops. So this should be fun Pin
Nelek20-Sep-20 7:36
protectorNelek20-Sep-20 7:36 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 23:13
professionalSander Rossel20-Sep-20 23:13 
GeneralRe: Ooops. So this should be fun Pin
Greg Utas20-Sep-20 6:40
mveGreg Utas20-Sep-20 6:40 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:45
mvahoney the codewitch20-Sep-20 6:45 
GeneralRe: Ooops. So this should be fun Pin
Nelek20-Sep-20 7:37
protectorNelek20-Sep-20 7:37 
GeneralRe: Ooops. So this should be fun Pin
David O'Neil20-Sep-20 7:40
professionalDavid O'Neil20-Sep-20 7:40 
GeneralRe: Ooops. So this should be fun Pin
Rick York20-Sep-20 9:16
mveRick York20-Sep-20 9:16 
GeneralRe: Ooops. So this should be fun Pin
David O'Neil20-Sep-20 17:10
professionalDavid O'Neil20-Sep-20 17:10 
GeneralRe: Ooops. So this should be fun Pin
Sander Rossel20-Sep-20 23:15
professionalSander Rossel20-Sep-20 23:15 
GeneralRe: Ooops. So this should be fun Pin
Dave Kreskowiak20-Sep-20 5:09
mveDave Kreskowiak20-Sep-20 5:09 
GeneralRe: Ooops. So this should be fun Pin
honey the codewitch20-Sep-20 6:47
mvahoney the codewitch20-Sep-20 6:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

What topics would you like to learn more about?
Contributed by Marc Clifton.
  Results   374 votes