Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Blocking Collections implementation suggestions C#

$
0
0

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



Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>