• (cs)

    :%s/Threads/Threadz/g

  • mastmaker (unregistered)

    fist?

    I know what you mean. I have met those gangsta (like Jerry) coders myself.

     

    Captcha: quality!

  • 'tini (unregistered) in reply to mastmaker

    Just so I know to avoid it, which site is "known best for its presentation of astonishingly low-quality, unedited articles and code samples"?

  • Lunaris (unregistered)

    s/C++ Experience/Debauchery/g

  • (cs) in reply to mastmaker

    Alex, I like your edit better than when I originally submitted it to you :P ... And I don't mind people knowing its me, if they fire me, they fire me (See 'Job "Security" ... HA' in the Side Bar WTFs) .. Its Brian K, not Brian R :) ... Well done Alex.

  • (cs) in reply to 'tini

    Anonymous:
    Just so I know to avoid it, which site is "known best for its presentation of astonishingly low-quality, unedited articles and code samples"?

    I don't think I'm allowed to post on here what sites he found the code snippets on without getting Alex in trouble, but feel free to email the address attached to my profile here :)

  • (cs) in reply to 'tini
    Anonymous:
    Just so I know to avoid it, which site is "known best for its presentation of astonishingly low-quality, unedited articles and code samples"?


    I honestly thought this was a sly reference to TheDailyWTF.com. :) I mean, how awesome would it be if some clueless coder actually copied code (try saying that 5 times fast) from here, and it eventually showed up... back here?


  • (cs)

    "I’ve only used Windows and, besides, isn't UNIX based on Windows."

    You ain't truely a gansta if you never mixed it up with the *nix-es, word.

    Meanwhile, a good song to play while reading this post is that rap in "Office Space".

  • WTF .. (unregistered) in reply to R.Flowers
    R.Flowers:
    Anonymous:
    Just so I know to avoid it, which site is "known best for its presentation of astonishingly low-quality, unedited articles and code samples"?


    I honestly thought this was a sly reference to TheDailyWTF.com. :) I mean, how awesome would it be if some clueless coder actually copied code (try saying that 5 times fast) from here, and it eventually showed up... back here?




    umm... you mean we are not supposta use this code in our "Enterprise" apps?
    ...
     umm .. I think maybe I might need some help then.

    when in doubt?
     Knock them out.
  • Steve (unregistered)

    Don't come down on Brian R too hard.  His daughter Paula won't think he's brilliant.

     

  • Bg Porter (unregistered)

      "you can't use MFC if you ever want to compile something outside of Windows"

    -- for what it's worth, you actually can buy a porting layer from mainsoft (www.mainsoft.com) that makes moving MFC projects to *nix pretty easy, or so they say.

    I only know them because I still have a frisbee they gave me at a trade show a few years back...

  • (cs)
    Alex Papadimoulis:

    public int ProcessIncomingMessage
      (int messageId, int messageType, char* message)
    {
      //spawn a new listener so we can process this
      int h = CreateThread(
        NULL, 0, ListenForMessage,
        (void *)this, 0, NULL);

      //now process the message
      int result = -1;
      switch (messageType)
      {
        case MSGTYP_M001:
          result = ProcessCvlMessage(messageId, message);
          break;
        case MSGTYP_M002:
          result = ProcessAplMessage(messateId, message);
          break;
        case MSGTYP_M003:
          if (this->routingLevel == 1)
            result = ProcessLcxMessage(messateId, message);
          else
            result = ReRouteMessage(messateId, MSGTYP_M008, message);
          break;

    Maybe it's only my 24 years of experience with c++, but why is this such a bad codeblock? I mean other than the message <> messate typos and the evil switch statement...

  • (cs)
    Alex Papadimoulis:
    "Huh," Jerry responded, "I’ve only used Windows and, besides, isn't UNIX based on Windows."


    Yup, just like how apples are based on frogs.... WTF lol...
    That line literally made my job drop.

    I should start putting on my Resume:
    40 Years experience in programming C++ in a Windows environment.
    60 Years experience in programming C++ in a *NIX environment.
    30 Years experience in programming C# in Windows 2003.

    Of course, once they realize that I'm not even 30..... lol ;-P

    "Uhhhhhhh, my father was a programmer too!" lol ;-)
  • cout (unregistered) in reply to Steve

    I think you mean "brillant".

  • (cs) in reply to Steve
    Anonymous:

    Don't come down on Brian R too hard.  His daughter Paula won't think he's brilliant.

    You mean on "Jerry"

  • S$ (unregistered)

    I call shenanigans here.  Half way through the method, the variable name changes from messageId to messateId.  As far as I can tell (although it's been a while since I worked in C++), the only way this would compile is if there was a global variable called messateId, which is, well, unlikely.

    [Note from Alex: this was a typo on my part]

  • (cs) in reply to Raider
    Raider:

    Anonymous:
    Just so I know to avoid it, which site is "known best for its presentation of astonishingly low-quality, unedited articles and code samples"?

    I don't think I'm allowed to post on here what sites he found the code snippets on without getting Alex in trouble, but feel free to email the address attached to my profile here :)

    I don't like to pick on specific companies or sites. But I figure that this reply will be burried far enough in the comments that a clue should be ok. The website in question (and I should note that I get a LOT of submissions directly linking to this site) starts with the the letter "c" and ends with "odeproject.com"

  • (cs) in reply to GoatCheez

    GoatCheez:
    Alex Papadimoulis:
    "Huh," Jerry responded, "I’ve only used Windows and, besides, isn't UNIX based on Windows."


    Yup, just like how apples are based on frogs.... WTF lol...
    That line literally made my job drop.

    Yeah, I got a HUGE laugh when he said that to me ... I really thought he was kidding at first, but he wasn't, at all ... He was absolutely serious ... He had never heard of the C++ Standard Library, he had never heard of anything that wasn't MFC/VC++ related. 

  • enigmatic (unregistered) in reply to GoatCheez
    GoatCheez:

    I should start putting on my Resume:
    40 Years experience in programming C++ in a Windows environment.
    60 Years experience in programming C++ in a *NIX environment.
    30 Years experience in programming C# in Windows 2003.

    Of course, once they realize that I'm not even 30..... lol ;-P

    "Uhhhhhhh, my father was a programmer too!" lol ;-)


    It's all about the dog years.

    FYI I've been coding .Net for over 35 years alone  

    Capcha - "shizzle" Snoop Dog is working here now?
  • Anonymous (unregistered) in reply to drdamour

    You're kidding right? Every call to the method spawns a new Thread! It might eventually get destroyed (I insist on the might seeing as this IS theDailyWTF), but still creating threads is costly!

  • (cs) in reply to S$

    Anonymous:
    I call shenanigans here.  Half way through the method, the variable name changes from messageId to messateId.  As far as I can tell (although it's been a while since I worked in C++), the only way this would compile is if there was a global variable called messateId, which is, well, unlikely.

    That code snippet was just something Alex used to illustrate the scanario, not something the guy actually wrote.

  • (cs) in reply to Anonymous

    Anonymous:
    You're kidding right? Every call to the method spawns a new Thread! It might eventually get destroyed (I insist on the *might* seeing as this IS theDailyWTF), but still creating threads is costly!

    The only time a thread got destroyed is when the connection was lost, and these systems were all built with the intentions of running for years without every shutting down.  We're talking hundreds of threads to potentially thousands at some of our largest customer bases, with NO semaphore usage whatsoever ... This code was nothing but race conditions ... But atleast he avoided deadlocks! ha

  • (cs) in reply to Alex Papadimoulis
    Alex Papadimoulis:
    Raider:

    Anonymous:
    Just so I know to avoid it, which site is "known best for its presentation of astonishingly low-quality, unedited articles and code samples"?

    I don't think I'm allowed to post on here what sites he found the code snippets on without getting Alex in trouble, but feel free to email the address attached to my profile here :)

    I don't like to pick on specific companies or sites. But I figure that this reply will be burried far enough in the comments that a clue should be ok. The website in question (and I should note that I get a LOT of submissions directly linking to this site) starts with the the letter "c" and ends with "odeproject.com"

    you have a point with the unedited articles - the site in general is a pretty good c# resource though.

  • Jboss (unregistered)

    I realy dont see a WTF here. And the snippet seams just fine (other than what it does ofc)...

    Captcha: knowhutimean

  • (cs) in reply to Jboss

    Anonymous:
    I realy dont see a WTF here. And the snippet seams just fine (other than what it does ofc)...

    Captcha: knowhutimean

    You don't see a WTF in spawning hundreds of threads ?? Or using code found on places like codeproject.com in production applications ... Code that is most likely untested, or barely test, more often than not, not made by reputable developers/development groups/etc ?? .... Wow ...

  • (cs) in reply to Raider
    Raider:

    Anonymous:
    I realy dont see a WTF here. And the snippet seams just fine (other than what it does ofc)...

    Captcha: knowhutimean

    You don't see a WTF in spawning hundreds of threads ?? Or using code found on places like codeproject.com in production applications ... Code that is most likely untested, or barely test, more often than not, not made by reputable developers/development groups/etc ?? .... Wow ...



    People who don't see a problem with spawning threads without destroying them would probably also have a tendency to leak memory all over the place.  Be sure not to step on any of it...
  • (cs) in reply to Raider
    Raider:

    Anonymous:
    I realy dont see a WTF here. And the snippet seams just fine (other than what it does ofc)...

    Captcha: knowhutimean

    You don't see a WTF in spawning hundreds of threads ?? Or using code found on places like codeproject.com in production applications ... Code that is most likely untested, or barely test, more often than not, not made by reputable developers/development groups/etc ?? .... Wow ...

     

    so you're saying that when a message was received, that thread didn't die once the message was routed appropriately? I think the snipet could have been better, especially since the post implied that the snipet was responsible for incorrect message routing.

  • kbiel (unregistered) in reply to Anonymous
    Anonymous:
    You're kidding right? Every call to the method spawns a new Thread! It might eventually get destroyed (I insist on the *might* seeing as this IS theDailyWTF), but still creating threads is costly!


    No it's quite normal to spawn threads to do the work.  But every good gansta coder knows, the boss don't give up his seat to do the dirty work, he sends workers off to do it.  If he's a smart boss, he might throw a pool party for his workers and dispatch them to their jobs from there instead of incurring the expensive of calling them up.

    CAPTCHA: java.  Perfect, I've been gansta coding the coffee for 20 years myself.
  • (cs) in reply to drdamour
    drdamour:
    Raider:

    Anonymous:
    I realy dont see a WTF here. And the snippet seams just fine (other than what it does ofc)...

    Captcha: knowhutimean

    You don't see a WTF in spawning hundreds of threads ?? Or using code found on places like codeproject.com in production applications ... Code that is most likely untested, or barely test, more often than not, not made by reputable developers/development groups/etc ?? .... Wow ...

     

    so you're saying that when a message was received, that thread didn't die once the message was routed appropriately?

    No, this is a misunderstanding ... The program acted as a daemon, used to accept connects from various instances of other applications, drivers, 3rd party software, etc, etc ... Each connection is treated as a single client.  Each time a client connected, that particular thread turned itself into a client thread, and spawned off another listener thread ... This was the recursive process it underwent, for hundreds of connections, where each connection was expected to remain established for months if not years.

  • (cs) in reply to drdamour
    drdamour:
    Alex Papadimoulis:

    public int ProcessIncomingMessage
      (int messageId, int messageType, char* message)
    {
      //spawn a new listener so we can process this
      int h = CreateThread(
        NULL, 0, ListenForMessage,
        (void *)this, 0, NULL);

      //now process the message
      int result = -1;
      switch (messageType)
      {
        case MSGTYP_M001:
          result = ProcessCvlMessage(messageId, message);
          break;
        case MSGTYP_M002:
          result = ProcessAplMessage(messateId, message);
          break;
        case MSGTYP_M003:
          if (this->routingLevel == 1)
            result = ProcessLcxMessage(messateId, message);
          else
            result = ReRouteMessage(messateId, MSGTYP_M008, message);
          break;

    Maybe it's only my 24 years of experience with c++, but why is this such a bad codeblock? I mean other than the message <> messate typos and the evil switch statement...

    It kinda depends on what is handled in the other functions i guess, but this could be a place to create a lot of threads which are not cleaned up.

    a thread for every message is a bit to much i think, if there are let's say 100 messages per second i guess the server could have a nice cpu load for only creating and closing threads.

  • (cs) in reply to kbiel

    Anonymous:
    Anonymous:
    You're kidding right? Every call to the method spawns a new Thread! It might eventually get destroyed (I insist on the *might* seeing as this IS theDailyWTF), but still creating threads is costly!


    No it's quite normal to spawn threads to do the work.  But every good gansta coder knows, the boss don't give up his seat to do the dirty work, he sends workers off to do it.  If he's a smart boss, he might throw a pool party for his workers and dispatch them to their jobs from there instead of incurring the expensive of calling them up.

    CAPTCHA: java.  Perfect, I've been gansta coding the coffee for 20 years myself.

    Yeah, spawning worker threads can often be helpful ... If you spawn off a few ... Spawning hundreds of them, all meant to stay running at all times, is without a doubt one of the most idiotic things anyone could do ... Especially without using any form of data synchronization.

  • (cs)
    Alex Papadimoulis:

     When he reviewed the code, Brian noticed was that there were a lot of copy/pasted functions, many in completely different coding styles. On a whim, Brian did a quick google search on one of the functions. And then another. And then another. After only a few minutes of searching, Brian found code from nine different articles, all posted on a certain website known best for its presentation of astonishingly low-quality, unedited articles and code samples.

    <FONT color=#000000>
    Alex Papadimoulis:
    </FONT>
    public int ProcessIncomingMessage
      (int messageId, int messageType, char* message)
    {
      //spawn a new listener so we can process this
      int h = CreateThread(
        NULL, 0, ListenForMessage,
        (void *)this, 0, NULL);
    

    //now process the message int result = -1; switch (messageType) { case MSGTYP_M001: result = ProcessCvlMessage(messageId, message); break; case MSGTYP_M002: result = ProcessAplMessage(messageId, message); break; case MSGTYP_M003: if (this->routingLevel == 1) result = ProcessLcxMessage(messageId, message); else result = ReRouteMessage(messageId, MSGTYP_M008, message); break;

    --- snip ---</PRE>
    

    After they let Jerry go, Brian spent two months rewriting the entire subsystem from scratch, taking full advantage of the C++ Standard Library instead of MFC. And this time, the SME compiled on both Windows and UNIX, didn't mix up messages, and was monumentally faster than its predecessor. Brian, you are a true, hard-core gangsta' coder.

    is it coincidence that googleing "C++ CreateThread" first result was

    http://www.codeproject.com/threads/thread_win32.asp

    with this gem of an example

    CreateThread ((NULL, 0, (unsigned long (__stdcall *)(void *))this->runProcess,
        (void *)this, 0, NULL);

  • (cs) in reply to drdamour
    drdamour:
    Maybe it's only my 24 years of experience with c++, but why is this such a bad codeblock? I mean other than the message <> messate typos and the evil switch statement...


    Maybe its just me, but that doesn't look like C++, or Java, but some frankenstein of the two.
    Hmm, how would a Java programmer handle a void *?

  • (cs) in reply to Raider

    <offTopic>

    I sometimes share my pc with a blind person, so the screen-reader software is enabled. It's not too bad with normal English text, but it usually trips all over itself on technical jargon. Throw in the misspellings and technical words in this blog, and it's hilarious to listen to. Go M$ !!!

    </offTopic>

  • (cs)

    The real WTF is that there is so little support for threads today. Try using a popular library in a thread and you'll probably get errors. You either have to reimplement things yourself or use special thread-safe libraries. Even the modern super-cool Boost library contains lots of stuff that isn't thread-safe.

  • (cs) in reply to drdamour
    drdamour:
    Raider:

    Anonymous:
    I realy dont see a WTF here. And the snippet seams just fine (other than what it does ofc)...

    Captcha: knowhutimean

    You don't see a WTF in spawning hundreds of threads ?? Or using code found on places like codeproject.com in production applications ... Code that is most likely untested, or barely test, more often than not, not made by reputable developers/development groups/etc ?? .... Wow ...

     so you're saying that when a message was received, that thread didn't die once the message was routed appropriately? I think the snipet could have been better, especially since the post implied that the snipet was responsible for incorrect message routing.


    It is irrelevant whether or not the thread is correctly shutdown once the message was handled.  The point is, a NEW thread was spawned every time a message was to be processed.  How many messages per second is this service meant to handle?  If you are spawning a new thread for every message, I can tell you it won't be many.  This is what thread pools were invented for. 

    Imagine what happens when the system receives 100 messages in a second (the upper limit, based on the 10ms timer): the OS will practically thrash itself to death trying to build up and tear down threads that often.  Nothing wrong with worker threads, but knowin' how to use 'em is kinda important yo.
  • (cs) in reply to HeroreV

    HeroreV:
    The real WTF is that there is so little support for threads today. Try using a popular library in a thread and you'll probably get errors. You either have to reimplement things yourself or use special thread-safe libraries. Even the modern super-cool Boost library contains lots of stuff that isn't thread-safe.

     

    dood, threads are hard. Especially now that there are dual cores mroe and more in production. Writing multithreaded apps that work with one processor (so only one thread can be executing at any one time) is one beast, writing them so 2 threads can excute simultaniously is a Godzilla monster.

  • WHO WANTS TO KNOW? (unregistered)

    <FONT size=4>MY GOD!!!!!!  How do such STUPID people find work!</FONT>

    Jerry seemed like a nice guy; he had "20 years of C++ experience," which, at the time, was older than C++ itself.

    That is a common piece of garbage!  I was once asked if I had 5 years or more of experience with VB5, and I told them what I had(LESS THAN 5 years), and said that if ***ANYONE*** said they had more, they were LYING!  Even the developer couldn't claim more, as the beta had changed a bit, etc...  Still, they seem to ALWAYS want 5 years +, even if the product came out yesterday!

    , wasn't joking. Brian, still being a nice guy, explained that you can't use MFC if you ever want to compile something outside of Windows. "Huh," Jerry responded, "I’ve only used Windows and, besides, isn't UNIX based on Windows."

    Actually, windows is a stupid imitation of X windows(which ran over UNIX) which came out a year BEFORE M/S Windows!  M/S Windows ran over M/S dos(which came out about 4 years BEFORE M/S Windows) which was an imitation of CP/M (which came out over 5 years BEFORE M/S DOS and about 1 year BEFORE MICROSOFT!!!!!!).  CP/M is obviously loosly based to some degree on UNIX which came out  about 5 years before THAT!

    MY GOD!  The I.E.E.E. standard predates microsoft by about 4 years!!!!!   NOT, WINDOWS, NOT DOS, but the ****ENTIRE COMPANY****

     

  • (cs) in reply to HeroreV

    HeroreV:
    The real WTF is that there is so little support for threads today. Try using a popular library in a thread and you'll probably get errors. You either have to reimplement things yourself or use special thread-safe libraries. Even the modern super-cool Boost library contains lots of stuff that isn't thread-safe.

    This is why G-d invented semaphores - so you can wrap the wtf's safely!

    *** If it was easy and all code was well-written, you wouldn't have a job making it better ***

  • (cs) in reply to Grimoire
    Grimoire:
    drdamour:
    Raider:

    Anonymous:
    I realy dont see a WTF here. And the snippet seams just fine (other than what it does ofc)...

    Captcha: knowhutimean

    You don't see a WTF in spawning hundreds of threads ?? Or using code found on places like codeproject.com in production applications ... Code that is most likely untested, or barely test, more often than not, not made by reputable developers/development groups/etc ?? .... Wow ...

     so you're saying that when a message was received, that thread didn't die once the message was routed appropriately? I think the snipet could have been better, especially since the post implied that the snipet was responsible for incorrect message routing.


    It is irrelevant whether or not the thread is correctly shutdown once the message was handled.  The point is, a NEW thread was spawned every time a message was to be processed.  How many messages per second is this service meant to handle?  If you are spawning a new thread for every message, I can tell you it won't be many.  This is what thread pools were invented for. 

    Imagine what happens when the system receives 100 messages in a second (the upper limit, based on the 10ms timer): the OS will practically thrash itself to death trying to build up and tear down threads that often.  Nothing wrong with worker threads, but knowin' how to use 'em is kinda important yo.

    Excuse my ignorance, but what would be the correct pattern for handling incoming (assuuming socket level) messages then?

    I'd think you have a listener thread, that spans workers for every message it has. so is the WTF there that the worker thread was spawning a listner?

     

    And how much of that snipet is of Alex's design vs what really was happening.

     

  • (cs) in reply to drdamour
    drdamour:

    HeroreV:
    The real WTF is that there is so little support for threads today. Try using a popular library in a thread and you'll probably get errors. You either have to reimplement things yourself or use special thread-safe libraries. Even the modern super-cool Boost library contains lots of stuff that isn't thread-safe.

     

    dood, threads are hard. Especially now that there are dual cores mroe and more in production. Writing multithreaded apps that work with one processor (so only one thread can be executing at any one time) is one beast, writing them so 2 threads can excute simultaniously is a Godzilla monster.

    Yeah tell me about it, we have dual, quad, and even 8 CPU systems here (Some cases single dual-core CPUs, dual- dual-core setups, etc), some on loan from Dell for testing to see if we want to buy them ... I'll tell you what though, making sure you do accurate data synchronizations is definately a lot easier on a multi-core/multi-cpu system since your code will crash more often if you did it wrong heh ..

  • (cs) in reply to Alex Papadimoulis
    Alex Papadimoulis:
    I don't like to pick on specific companies or sites. But I figure that this reply will be burried far enough in the comments that a clue should be ok. The website in question (and I should note that I get a LOT of submissions directly linking to this site) starts with the the letter "c" and ends with "odeproject.com"


    I find that particularly amusing.

    It also explains why I always leave that site with a more confused feeling than when I arrived, only to find a simpler, less over-engineered answer somewhere else.
  • (cs) in reply to Raider
    Raider:


    snip..

    Or using code found on places like codeproject.com in production applications ... Code that is most likely untested, or barely test, more often than not, not made by reputable developers/development groups/etc ?? .... Wow ...



    I think articles on sites like codeproject are only good if you take them in context.  The WTF is when *developers* use it as a copy paste resource without understanding what the hell the code is doing.  That's how they end up here.
  • (cs) in reply to WeatherGod
    WeatherGod:
    "I’ve only used Windows and, besides, isn't UNIX based on Windows."

    You ain't truely a gansta if you never mixed it up with the *nix-es, word.

    Meanwhile, a good song to play while reading this post is that rap in "Office Space".


    You mean...Scarface the Rapper?

    I got my SQL script cocked
    Ready to lay down queries non-stop until I see your data tables drop
    And let your managers know who done it
    'Cuz when it comes to this database s*** you programmers know who run it


    (modified; from "No Tears."  With apologies.)
  • Anonymous (unregistered) in reply to kbiel

    A threadpool should be used and obviously the thread has to be cleaned up, however delegating the next listen to another thread (sometimes referred to as "Leader / Followers") is not unreasonable to use as it avoids a context switch.

  • (cs) in reply to Raider
    Raider:
    drdamour:

    HeroreV:
    The real WTF is that there is so little support for threads today. Try using a popular library in a thread and you'll probably get errors. You either have to reimplement things yourself or use special thread-safe libraries. Even the modern super-cool Boost library contains lots of stuff that isn't thread-safe.

     

    dood, threads are hard. Especially now that there are dual cores mroe and more in production. Writing multithreaded apps that work with one processor (so only one thread can be executing at any one time) is one beast, writing them so 2 threads can excute simultaniously is a Godzilla monster.

    Yeah tell me about it, we have dual, quad, and even 8 CPU systems here (Some cases single dual-core CPUs, dual- dual-core setups, etc), some on loan from Dell for testing to see if we want to buy them ... I'll tell you what though, making sure you do accurate data synchronizations is definately a lot easier on a multi-core/multi-cpu system since your code will crash more often if you did it wrong heh ..

     

    that is true, whenever we have a threading issue, the instructions to reproduce usually have the following parts:

    Do a lot of stuff, fast

    Not always reproducable

    Get lots of people doing the same thing

    Stand on your head

    Run some other program

    Leave the system and come back to it

    etc. etc.

     

    I'd take lots of reproducable hard crashing code, over intermittent crashing code any day. especially for in production, not debug mode systemts

     

  • (cs) in reply to drdamour

    Ok, let me straighten everything out now ...

    It did *NOT* spawn a new thread for every *message*, it spawned a new thread for every *connection* ... A connection could send millions of messages, or only a few messages, could be online for a day, or for a year ...

    The problem is it created hundreds of threads, period ... It doesnt matter if they would be destroyed a second later, or a year later ... Anyone that writes an app that spawns one thread per connection, and leaves them running, anticipating hundreds, to thousands of connections, really needs to go back to the drawing board and learn about non-blocking sockets, or select(), or some other form of socket management.

    I agree with, and have used worker threads when handling massive quantities of data (Note: We're talking millions upon millions of transactions going through this app daily), but to spawn that many is a sure fire way to make anyone with half a brain about C++ gag.

  • (cs) in reply to drdamour
    drdamour:

    is it coincidence that googleing "C++ CreateThread" first result was

    http://www.codeproject.com/threads/thread_win32.asp

    with this gem of an example

    CreateThread ((NULL, 0, (unsigned long (__stdcall *)(void *))this->runProcess,
        (void *)this, 0, NULL);


    I stumbled across this one recently: http://www.codeproject.com/system/xservice.asp
    Full of memory leaks, crashes, re-implementing existing stl functionality, ignoring errors, you name it, it has it.  Allocate memory in your class, and not even having a destructor is about as fundamentally wrong as it gets.
  • (cs) in reply to Raider

    so why was it processing messages wrong?

  • (cs) in reply to WHO WANTS TO KNOW?
    Anonymous:

    <font size="4">MY GOD!!!!!!  How do such STUPID people find work!</font>

    Jerry seemed like a nice guy; he had "20 years of C++ experience," which, at the time, was older than C++ itself.

    That is a common piece of garbage!  I was once asked if I had 5 years or more of experience with VB5, and I told them what I had(LESS THAN 5 years), and said that if ***ANYONE*** said they had more, they were LYING!  Even the developer couldn't claim more, as the beta had changed a bit, etc...  Still, they seem to ALWAYS want 5 years +, even if the product came out yesterday!

    , wasn't joking. Brian, still being a nice guy, explained that you can't use MFC if you ever want to compile something outside of Windows. "Huh," Jerry responded, "I’ve only used Windows and, besides, isn't UNIX based on Windows."

    Actually, windows is a stupid imitation of X windows(which ran over UNIX) which came out a year BEFORE M/S Windows!  M/S Windows ran over M/S dos(which came out about 4 years BEFORE M/S Windows) which was an imitation of CP/M (which came out over 5 years BEFORE M/S DOS and about 1 year BEFORE MICROSOFT!!!!!!).  CP/M is obviously loosly based to some degree on UNIX which came out  about 5 years before THAT!

    MY GOD!  The I.E.E.E. standard predates microsoft by about 4 years!!!!!   NOT, WINDOWS, NOT DOS, but the ****ENTIRE COMPANY****

     



    Well I see that you enjoy the rich text editor...
    While MS-DOS was influenced by CP/M and CP/M was influcenced by UNIX, they are seperate systems with seperate aims.
    MS Windows has absolutely no relation to the X Windowing System in any way. (And it's not called "X Windows" dammmit!).
    And WTF does the IEEE have to do with anything?

Leave a comment on “Flossin' My Threads”

Log In or post as a guest

Replying to comment #85557:

« Return to Article