Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesMultiThreading?MultiThreading?
Previous
 
Next
New Post
1/5/2010 12:13 PM
 

I'm developing a module. In this module the user has to specify a number of settings for one or more jobs. Each job consists of large processor intensive calculations (that take a long time to complete). At the end of which an e-mail should be send to the user. During the time the module is calculating I need my website to stay responsive. What's the best way to go about this?

Your help is much appreciated.

 
New Post
1/6/2010 6:56 AM
Accepted Answer 

Web servers and long running tasks are normally not a good combination, I would split it into to two separate parts; a Windows service that controls the calculating tasks/threads and a web module for reciving calculation requests.

The web module needs to be able to transfer the tasks to the service, and as the user does not want to wait for the calculation result, the best option IMHO would be an async transfer. This could easily be implemented as adding a calc order row to a table in a shared database, or by placing task info files in a shared folder.

It is much easier to control server load and error handling in a windows service application (single application), than a web module that is not a singleton (you can have many concurrent instances of the module if you have many web requests to the same module).

If you use a database as shared medium for communication, it is much easier to create a setup with multiple machines doing calculation from the same queue (task info table). This will enable you to share the load of the calculations to multiple machines.


/Bo Nørgaard ( www.dotnetnuke.dk )
 
New Post
1/11/2010 5:24 AM
 

Thank you. Apologies for my late response, but I don't receive e-mail notifications (while I did select it).

There is one limitation on using a windows service, isn't there: hosting my application will be difficult / impossible?

You wouldn't happen to know a good (web)reference on windows service programming?

 
New Post
1/11/2010 7:48 AM
 

Hi

Most web hosting providers will automatically kill your thread anyway, as they see long running thread as a sign of an error (endless loop). And even if they dont - they will not be happy hosting your web site as it destroy the performance of the other clients on the same server.

Try to search the market of hosted virtual machines, after Amazon entered the market the prices have become attractive.

Code Project has many articles, here is one that you can start with Windows Services in Action - it is in C# but you can find others that are VB based if you prefer that.


/Bo Nørgaard ( www.dotnetnuke.dk )
 
New Post
1/11/2010 11:47 AM
 

Thank you!

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesMultiThreading?MultiThreading?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out