Click here to Skip to main content
15,867,921 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am building an Asp.Net application and wander if it's a sort of important to load a heavy page's content using multithreading. Let suppose we have a certain page that contains three main methods in its load_page method, and that those three methods perform logic and heavy operations such as database access and some other operations that may delay a little. So, should those three methods be implemented in different threads or I should just let them in the page load method to be executed? I really want the page's loading not to interfere with these heavy operations. What should I do? and what will I gain from separating these methods from the main page load's thread.
Looking forward to hearing from you.
Posted
Updated 3-Sep-12 10:16am
v2
Comments
virang_21 3-Sep-12 20:14pm    
If database operation to display some information you don't need to load all the data .. just select only number of records that you want to show on that page... it is always better to select top 100 records then selecting say 100000 records and displaying just 100 of them... implement lazy loading ... Avoide any resource intensive calculations / operations in page load if you can...

You're thinking about it a little backwards. The page load will not affect those "heavy operations" at all. It's the heavy operations that will affect the page loading.

Since the content is generating what is viewed on the page (I'm assuming!) the user won't see the page until those operations are done.
 
Share this answer
 
Hi,

I prefer to read about Asynchronous method calling.

Please read MSDN : Async Method call in ASP.NET[^]

In web application, you really need to look into optimization of your time consuming methods. You need to design your UI very smartly so page load will not take more time. you can use Paging/Tabs/PopUp pages/Dialog box. Do not load everything in one go.

There should not be any timeconsuming method except Calling Web method/Calling remote database/ Heavy UI. (And even this should be optimize)

Hope this information helps you,
Thanks
-Amit Gajjar
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900