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. General Programming
  3. C#
  4. Good Tip for C# Threading in Windows Service

Good Tip for C# Threading in Windows Service

Scheduled Pinned Locked Moved C#
csharpdebugginghelp
1 Posts 1 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.
  • M Offline
    M Offline
    Malcolm Smart
    wrote on last edited by
    #1
    using System.Threading;
    Thread myThread = new Thread(new ThreadStart(_listener.Prepare));
    myThread.Start();
    

    The Start call on myThread is quite important. Without it, the thread doesn't start, and no amount of debug code in the 'Prepare' method will get called and you look a complete arse when you ask a colleague for help. If you call Start on your thread, your thread starts and everything is really good. It's gonna be one of those weeks.

    Knowledge is hereditary, it will find its way up or down. - Luc Pattyn
    so you answer don't be scared of failure The only failure is never to try Things You've Never Done - Passenger -2008

    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