You must Sign In to post a response.
  • Category: Windows

    How to use threading as per user based

    Hi,

    I have a code snippet, which is kept inside the timer control.
    Steps
    1. This timer will hit the database every 2 seconds and get the records which the status is false.
    2. Pause the timer to process the top 1 record.
    3. After getting the records, take the top 1 record and processes functionality.
    4. Start the timer after processing the top 1 record.

    The above code working well for record by record.

    Now I want to enhance this code to process the records parallel processing, like if multiple users submitted the request then my code should process every users request at a time.

    Please tell me some suggestions to achieve the new functionality.

    The above code is used in the Windows service and installed in the server.

    Thanks
  • #763639
    Hai Sarayu,
    I think, you can have the user id attached for this scenario so that everything will be done based on the user.
    So when a new user is loggedin:
    1. This timer will hit the database every 2 seconds and get the records which the status is false.- For the current user
    2. Pause the timer to process the top 1 record- for the current user
    3. After getting the records, take the top 1 record and processes functionality- for the current logged in user
    4. Start the timer after processing the top 1 record- for the current user
    Hope it will be helpful to you.

    Regards,
    Pawan Awasthi(DNS MVM)
    +91 8123489140 (whatsApp), +60 14365 1476(Malaysia)
    pawansoftit@gmail.com


Sign In to post your comments