473,480 Members | 3,098 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP.NET Threading Questions

Hello!

I have a C# ASPX page that displays a large amount of information. The
software loops through 500 lines of code (and some of the 500 lines are
looped multiple times, in a loop). Naturally, it takes approximately 7
seconds for the Page_Load event to fire (where I have all of my code).

I thought that going down the threading road would be a good idea – it cut
my execution time in half. However, sometimes the thread finishes after the
page has displayed, a bad deal. How do you generate large amounts of data,
and then display it? Are there any threading tricks?

Thanks,

JMax

Mar 15 '06 #1
3 1361
JMax,

Threading in an ASP.NET application when you only have one task to
complete (your loop) is a bad idea. The reason is that you are starting up
another thread while your processing thread (the one that returns the
response to the browser) is basically sitting around waiting (it should be
waiting, that is).

Unless you can break out the task in the loop to other threads (which
you have to wait for), there is no point in doing what you are doing. You
will have to consider what the page is doing, and see if you can offload the
processing to another process.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"JMax" <JM**@discussions.microsoft.com> wrote in message
news:08**********************************@microsof t.com...
Hello!

I have a C# ASPX page that displays a large amount of information. The
software loops through 500 lines of code (and some of the 500 lines are
looped multiple times, in a loop). Naturally, it takes approximately 7
seconds for the Page_Load event to fire (where I have all of my code).

I thought that going down the threading road would be a good idea - it cut
my execution time in half. However, sometimes the thread finishes after
the
page has displayed, a bad deal. How do you generate large amounts of data,
and then display it? Are there any threading tricks?

Thanks,

JMax

Mar 15 '06 #2
Hello JMax,

Are you really need to show all that data on one page? Maybe to apply asyc
calls to get dependent data? To show minumum info for user
and all dependent data (for example data in dropdown boxed) get async?

J> I have a C# ASPX page that displays a large amount of information.
J> The software loops through 500 lines of code (and some of the 500
J> lines are looped multiple times, in a loop). Naturally, it takes
J> approximately 7 seconds for the Page_Load event to fire (where I have
J> all of my code).
J>
J> I thought that going down the threading road would be a good idea -
J> it cut my execution time in half. However, sometimes the thread
J> finishes after the page has displayed, a bad deal. How do you
J> generate large amounts of data, and then display it? Are there any
J> threading tricks?
J>
J> Thanks,
J>
J> JMax
J>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 15 '06 #3
HI,
I thought that going down the threading road would be a good idea - it cut
my execution time in half. However, sometimes the thread finishes after
the
page has displayed, a bad deal. How do you generate large amounts of data,
and then display it? Are there any threading tricks?


It's not a good idea, it does the opposite as a matter of fact.
You have two options:
1- try to send chuck of the page back to the client, so the client sees part
of the page whiel you are generating the rest.
2- try to show less data in your page and use pagination if possible

You do not especify details about your problem so we cannot give you better
answer, you could also use caching or maybe improve the data generation
algorithm.
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

Mar 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

65
6657
by: Anthony_Barker | last post by:
I have been reading a book about the evolution of the Basic programming language. The author states that Basic - particularly Microsoft's version is full of compromises which crept in along the...
13
2687
by: Varun | last post by:
Hi Friends, Department of Information Technology, Madras Institute of Technology, Anna University, India is conducting a technical symposium, Samhita. As a part of samhita, an Online Programming...
4
1572
by: Antal Rutz | last post by:
Hi, All! I'm new to threading. I have some design questions: Task: I collect data and store them in an RDBMS (mysql or pgsql) The question is how to do that with threading? The...
77
5206
by: Jon Skeet [C# MVP] | last post by:
Please excuse the cross-post - I'm pretty sure I've had interest in the article on all the groups this is posted to. I've finally managed to finish my article on multi-threading - at least for...
3
5954
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
4
1282
by: Bob | last post by:
- For cleanup, is it sufficient to set a Thread to Nothing after it's done? - It is OK to pass objects out of the thread? (dumb question maybe but I want to be sure) - What's the best way to...
9
2162
by: akrapus | last post by:
Hi, I am trying to understand how to use threading in Python. I get threading as a concept, but not the implementation. In order to start threading, do you call it as a separate function,...
4
321
by: DBC User | last post by:
I have a background process which reads a table to see if there are any pending requests. If there are any, then it will start a worker thread (only 10 allowed at a time) and executes a method. In...
7
2841
by: kimiraikkonen | last post by:
Hello experts, I've been already working on a project and also asked and i've managed to create a basic Gmail mail sender, but i want to add a progressbar that shows "sending is in progress" but...
126
6595
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
0
7055
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6920
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4503
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3011
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
574
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
210
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.