I'm putting together a web app that will process time consuming jobs in the background.

so for example 100 users are on the site 20 of them submit jobs to the server. these 20 jobs get added to a list and the background worker pickes them up one by one. I want to be able to have up to 10 background workers doing the tasks.

for scaleability the job list is likely to be a database table, however at the proof of concept stage I will probably use an application variable (stack of some sort) with a GUID to identify each job.

So I *think* what I need is ....

a single background worker process that starts when the web app starts.

This process monitors the stack / job list. It dynamically creates a worker process for the first item, removes the job from the stack and increments the thread count.

If there is a second job it creates another thread (up to 10) and increments the thread counter.

When each thread finishes it closes itself and decrements the thread count.

Does this seem possible / sensible?

If I move to the database table job list would it be better to have ASP.Net add jobs and a windows service do the processing?