none
Blocking Collections implementation suggestions C# RRS feed

  • Question

  • Hi All,

    Need some suggestion regarding implementation of blocking chain collection(producer, consumer implementation) for a following use case :

    Currently, working on a some sort of claim handling application where end user wants us to trigger some functionality without disrupting the current performance of the application(i.e. saving time of a particular claim).

    Hence, we were thinking of implementing it by making use of TPL  libraries available to us.(i.e. making use of extra thread to do the implementation)

    As per the use case, we are trying to trigger this functionality everytime user(they will act as producer) saves or updates the claim

    What we want't to achieve is for a single user on a given machine we should have only one thread which will act as a producer

    and one thread which will act as a consumer(irrespective of how many claims he is working with).

    Idea is to have some static blocking collection class which will be handled by single producer and consumer thread from the thread pool for a given instance of an application(desktop application)

    Here are few questions regarding the implemention:-

    Can we achieve the above problem by making use of blocking collections(or there is something else we should explore..perhaps something better)?

    If yes, Is it fine to use static blocking collection across the application?

    Above implemention will also include use of reflection classes?

    Making use of cancellation token so that if nothing is not happening for certain amount of time..cancel that task.

    My main concern is not to degrade the application performance as well don't want to create too much of independent threads (i.e. one thread per claim) in order to achieve the above implementation

    N.B => will get trigger for a particular claim only if certain condition in claims data are met..


    Application details:

    WPF

    .Net Framework 4.0

    regards,

    RT


    Rajbir Thakur


    Friday, January 18, 2019 1:45 PM

All replies

  • Hi rajbir1190,

    Thank you for posting here.

    For your question, could you provide more details about the code sample and error message?

    According to your description, if your question is more related to WPF, you could post a new thread in 

    WPF forum for suitable support.

    https://social.msdn.microsoft.com/Forums/en-US/home?forum=wpf&filter=alltypes&sort=lastpostdesc

    Best Regards,

    Wendy


    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, January 21, 2019 6:15 AM