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. Threads in Windows Service

Threads in Windows Service

Scheduled Pinned Locked Moved C#
6 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.
  • A Offline
    A Offline
    ayandelhi
    wrote on last edited by
    #1

    Hi!! Can anyone tell me if i can use threading in my windows service... i've 3 module which i want to run concurrently.. will it be easier to run by threads or on timer basis...

    Richard Andrew x64R G D 3 Replies Last reply
    0
    • A ayandelhi

      Hi!! Can anyone tell me if i can use threading in my windows service... i've 3 module which i want to run concurrently.. will it be easier to run by threads or on timer basis...

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      Of course you can use multiple threads inside a Windows Service. Whether or not you should is something that we can't tell you unless you provide more information.

      1 Reply Last reply
      0
      • A ayandelhi

        Hi!! Can anyone tell me if i can use threading in my windows service... i've 3 module which i want to run concurrently.. will it be easier to run by threads or on timer basis...

        G Offline
        G Offline
        geo_m
        wrote on last edited by
        #3

        You can use threads easily in windows services. But if you can use .net 40 I'd suggest you check the new Task Parallel Library before you decide.

        P 1 Reply Last reply
        0
        • G geo_m

          You can use threads easily in windows services. But if you can use .net 40 I'd suggest you check the new Task Parallel Library before you decide.

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          geo_m wrote:

          But if you can use .net 40 I'd suggest you check the new Task Parallel Library before you decide.

          .net 40? I want your time machine.

          "WPF has many lovers. It's a veritable porn star!" - Josh Smith

          As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

          My blog | My articles | MoXAML PowerToys | Onyx

          G 1 Reply Last reply
          0
          • A ayandelhi

            Hi!! Can anyone tell me if i can use threading in my windows service... i've 3 module which i want to run concurrently.. will it be easier to run by threads or on timer basis...

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            You're actually expected to use threads in a service. IMHO, using a timer to hold up your service is just an excuse to not learn threading. Too many schmucks try to use a timer to do something that it's not designed to do and doesn't fit the problem they're trying to solve.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            1 Reply Last reply
            0
            • P Pete OHanlon

              geo_m wrote:

              But if you can use .net 40 I'd suggest you check the new Task Parallel Library before you decide.

              .net 40? I want your time machine.

              "WPF has many lovers. It's a veritable porn star!" - Josh Smith

              As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

              My blog | My articles | MoXAML PowerToys | Onyx

              G Offline
              G Offline
              geo_m
              wrote on last edited by
              #6

              heh, too many dots - .net 4.0 is exact. We're used here to write it in this short manner .net20, .net30, .net35, .net40. I use it so often - googling, referencing, also can be found in some original microsoft comments so I didn't even realize that it's a way too ahead in time :)

              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