none
PollGroup Scenario In Windows Service RRS feed

  • Question

  • Hello,

    I am creating windows service in C# in which I have 3 Poll Groups having 3 Different Time Intervals as

    Poll Group 1 - 2 Sec [Priority 1]/ Poll Group 2 - 3 Sec [Priority 2]/ Poll Group 3 - 4 Sec [Priority 3]

    Each Poll Group May contain one or more Machines Like 

    For Example 

    Poll Group 1 - Machine 1,Machine 2/ Poll Group 2 - Machine 3/ Poll Group 3 - Machine 4,Machine 5

    Each Machine Have its own piece of Method to be execute

    What I want is how can I handle this Poll Group scenario in windows service in order to avoid clashing of code execution

    Suppose At 10:00 my service gets started

    so 10:00:00 - Machine 1 of PG1 will execute its code

    10:00:02 - Machine 2 of PG1 will execute its code

    10:00:03 - Machine 3 of PG2 will execute its code

    10:00:04 - Machine 1 of PG1 will execute its code -----This will clash with Poll Group 3 - 4 Sec [Priority 3]

    Please tell me how can I handle this kind of senario

    • Moved by Sabah ShariqMVP Friday, March 17, 2017 12:59 PM Moved From Visual C#
    Friday, March 17, 2017 12:52 PM

All replies

  • Hi Tech Aspirant,

    This is Visual C# forum. As your issue is related to Windows Service I am moving your thread to WCF forum for getting quick response.

    Your understanding and cooperation will be grateful.

    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Friday, March 17, 2017 12:59 PM
  • >> What I want is how can I handle this Poll Group scenario in windows service in order to avoid clashing of code execution

    How did you poll group? Did you use multiple thread or task?

    >> 10:00:04 - Machine 1 of PG1 will execute its code -----This will clash with Poll Group 3 - 4 Sec [Priority 3]

    Do you mean if PG1 has executed, PG 3 would not execute? I suggest you check below link.

    # Polling the right way?

    http://stackoverflow.com/questions/23340894/polling-the-right-way


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 20, 2017 7:14 AM