Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. Threading horror

Threading horror

Scheduled Pinned Locked Moved The Weird and The Wonderful
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tony Pottier
    wrote on last edited by
    #1

    Found in my own code:

    while (t.IsAlive)
    {
    //wait for thread to exit
    }

    I laughed inside, that was quite a while back. t.Join() looks prettier.

    P N 2 Replies Last reply
    0
    • T Tony Pottier

      Found in my own code:

      while (t.IsAlive)
      {
      //wait for thread to exit
      }

      I laughed inside, that was quite a while back. t.Join() looks prettier.

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #2

      Right, no one pointed Join out to me either until earlier this year.

      1 Reply Last reply
      0
      • T Tony Pottier

        Found in my own code:

        while (t.IsAlive)
        {
        //wait for thread to exit
        }

        I laughed inside, that was quite a while back. t.Join() looks prettier.

        N Offline
        N Offline
        notmasteryet
        wrote on last edited by
        #3

        Look at bright side: if you have two processors (or dual-core processor), the second one will be busy with something. :)

        L G 2 Replies Last reply
        0
        • N notmasteryet

          Look at bright side: if you have two processors (or dual-core processor), the second one will be busy with something. :)

          L Offline
          L Offline
          Lutoslaw
          wrote on last edited by
          #4

          ...and you will not lie if you say to a client: see that 100%? Our software fully utilizes CPU power.

          Greetings - Gajatko Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.

          1 Reply Last reply
          0
          • N notmasteryet

            Look at bright side: if you have two processors (or dual-core processor), the second one will be busy with something. :)

            G Offline
            G Offline
            geoffs
            wrote on last edited by
            #5

            That was a funny comment for sure, but... unless he had raised his thread's priority above most other threads in the system, the o/s would preemptively schedule other threads to run, so both processors would still be doing some useful work.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups