Handling workload of raised events in background threads in C# 4 and controlling the number of threads
===

I have a C# 4 application that is subscribing for an event which I expect to be raised a very large number of times in quick succession. Each time it is raised a bit of work is required to be done that I don't really want to block the event thread with.

It feels like I should pass off this "chunk" of work to a background thread / task and allow the event thread to continue, however I also need to make sure that too many threads aren't created as, as I say, I expect this event to be raised a lot of times quickly.

Is there a recognized pattern or recommended approach for passing off event handler workload to background threads but limiting the amount of threads created?

It feels like there should be some way of using the Task Parallel Library for this, but can't find anything that does exactly what I need at the moment.

Let me know if anyone needs any more information, as I appreciate I've been quite general with what I've said.

Thanks.