I'm currently building an Asp.Net website that will allow to import data in several formats into a database. The import status of the the single import jobs are visible to all users and given that a user has sufficient privileges he can also stop an import started by another user. If an import goes through the data is written to a sql-server instance. (Data management ist done through nhibernate)I would need some pointers on the best practices to construct a shared threadpool that allows cancellation of tasks. Up to now i've thought that something like this could be implemented best using a blocking queue following a producer-consumer pattern. Each user can generate jobs that are gathered in a single service which then adds the job to the queue. The service would then also hold a separate list with the job id's and their corresponding cancellation tokens.Edit: The version used is Asp.Net MVC 5. The blocking queue would utilize the Task Parallel Library. The size of the files to import ranges from 50kb to 5 mb.
Asp.Net Architecture of a thread pool for several users
c#;asp.net mvc