Click here to Skip to main content
15,891,409 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: Multithreading done "right" PinPopular
CDP180222-May-12 3:24
CDP180222-May-12 3:24 
GeneralRe: Multithreading done "right" Pin
Gary Wheeler22-May-12 6:33
Gary Wheeler22-May-12 6:33 
GeneralRe: Multithreading done "right" Pin
PIEBALDconsult22-May-12 7:53
mvePIEBALDconsult22-May-12 7:53 
GeneralRe: Multithreading done "right" Pin
AspDotNetDev22-May-12 8:13
protectorAspDotNetDev22-May-12 8:13 
GeneralRe: Multithreading done "right" Pin
BobJanova22-May-12 23:47
BobJanova22-May-12 23:47 
GeneralRe: Multithreading done "right" Pin
BobJanova22-May-12 23:47
BobJanova22-May-12 23:47 
GeneralRe: Multithreading done "right" Pin
jschell23-May-12 10:05
jschell23-May-12 10:05 
GeneralRe: Multithreading done "right" Pin
Member 767931323-May-12 7:58
professionalMember 767931323-May-12 7:58 
Call me a nice guy who generally gives people the benefit of the doubt, but this looks like code where someone INTENDED for some operations to occur on separate threads asynchronously, put some of the plumbing in, put a thread.join in for synchronous debugging, and never got back to it.

You are correct in that the code would be more performant without creating the additional thread as they presently are, but the context of the usage is also important in determining your predecessor's intent. If GenerateTimeLineImage() is a void function that is basically a "fire and forget" service call, commenting out m_thread.Join() might increase application performance, and by quite a bit.

I'll tell you that there is no hidden magic, but you haven't provided enough context for me to be as condemning as some other folks here.
GeneralRe: Multithreading done "right" Pin
CDP180223-May-12 10:39
CDP180223-May-12 10:39 
GeneralRe: Multithreading done "right" Pin
KP Lee24-May-12 21:34
KP Lee24-May-12 21:34 
GeneralRe: Multithreading done "right" Pin
Florin Jurcovici10-Jul-12 4:28
Florin Jurcovici10-Jul-12 4:28 
GeneralAJAX calender Pin
Arul R Ece17-May-12 18:31
Arul R Ece17-May-12 18:31 
GeneralRe: Quote Pin
Rahul Rajat Singh17-May-12 21:44
professionalRahul Rajat Singh17-May-12 21:44 
GeneralRe: Quote PinPopular
Sander Rossel19-May-12 0:35
professionalSander Rossel19-May-12 0:35 
GeneralRe: Quote Pin
BillW3319-May-12 6:58
professionalBillW3319-May-12 6:58 
GeneralRe: Quote Pin
Dalek Dave21-May-12 22:25
professionalDalek Dave21-May-12 22:25 
GeneralRe: Quote Pin
KP Lee24-May-12 21:41
KP Lee24-May-12 21:41 
GeneralReflection Optimization Pin
Mike Marynowski17-May-12 13:46
professionalMike Marynowski17-May-12 13:46 
GeneralRe: Reflection Optimization Pin
Ankush Bansal17-May-12 18:11
Ankush Bansal17-May-12 18:11 
GeneralRe: Reflection Optimization Pin
Mike Marynowski17-May-12 18:36
professionalMike Marynowski17-May-12 18:36 
GeneralRe: Reflection Optimization Pin
CDP180219-May-12 4:29
CDP180219-May-12 4:29 
GeneralRe: Reflection Optimization Pin
Mike Marynowski19-May-12 4:59
professionalMike Marynowski19-May-12 4:59 
GeneralRe: Reflection Optimization Pin
CDP180219-May-12 23:04
CDP180219-May-12 23:04 
GeneralRe: Reflection Optimization Pin
Brisingr Aerowing23-May-12 13:02
professionalBrisingr Aerowing23-May-12 13:02 
GeneralRe: Reflection Optimization Pin
CDP180223-May-12 21:31
CDP180223-May-12 21:31 

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.