Multithreading

  • Thread starter Thread starter Boris Condarco
  • Start date Start date
B

Boris Condarco

Hi,

I have to develop an application, whose main feature is: read data from
DataBase, do many calculations, then write back the results to the DataBase,
and finally show it to the user.

This calculations are based on different formula, so i was thinking to
develop a multithreaded Web Based application, in this order i have the
following questions:

Which aspects do i have to consider before, during and after the life cycle
of the program?

How many theads can be created simultaniusly on ASP.NET?

Is there any configuration file to improve the threads performace?

I would really appreacite any suggestions...!

Thanks in advance...

Boris
 
ASP.NET will handle all of your threading for you. It's not really like VB
COM in that respect, basically, I think your assemblies in ASP.NET are free
threaded, so it'll keep going until you say stop.

One of the really great things about .net, it's all disconnected. You
basically connect to the database to grab your data, do your processing
'offline' so to speak, and reconnect to post your changes back to the
database. In former ADO, you'd most likely of have had to stay connected to
the database throughout your processing, which would quickly form a bottle
neck under any sort of load (holding a connection to a database is the
biggest waste of resource imaginable). With ADO.NET however, this doesn't
exist as the time you're connected to the database is minimal.

Your objects will run several instances concurrenly if you build your
classes correctly. We do a lot of work that involves very very heavy
processing on disconnected data, and this has never proven to be a big
scalability problem.

I don't believe there's any specific limit on the number of threads IIS
(ASP.NET) can handle - it'll just keep on adding until your processor or
memory resource starts to run out.

As for configuration, there's always the odd tweak you can do, but if you
follow good coding practice, my guess is it'll be ok.

Paul
 
Wrong. There is a limit on the number of threads ASP.NET can manage.
This limit is define in the machin.config file under the processmodel tag
using the MaxWorkerThread attribute.
This value can be change but above a certain value asp.net collapse.
So, becarefull when you decide to create more threads.
One solution could be to use the thread pool (ThreadPool class) in this case
you will not create more
thread but use the existing ones. But it's not a good idea if your task is
takes a lot of time.
 
learn something new every day :)

Joël said:
Wrong. There is a limit on the number of threads ASP.NET can manage.
This limit is define in the machin.config file under the processmodel tag
using the MaxWorkerThread attribute.
This value can be change but above a certain value asp.net collapse.
So, becarefull when you decide to create more threads.
One solution could be to use the thread pool (ThreadPool class) in this case
you will not create more
thread but use the existing ones. But it's not a good idea if your task is
takes a lot of time.

connected
 
I'm not sure from your message what you think multithreading can do for you
in this application. You can use multithreading to run 2 or more different
procecesses simultaneously, but from your description that isn't what you're
after.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.
 
Back
Top