473,405 Members | 2,279 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

MultiThreading

Hi,

I am trying to run a complex report in my asp.net application. The method
which executes the report runs in a SEPERATE thread from threadpool other
than the main application thread.

The New thread calls a sub called ExecuteReport Which has the following code

Sub ExecuteReport [this sub runs on seperate thread from threadpool]
<do all report tasks>
RaiseEvent ReportComplete
end sub

The Reportcomplete is the event I declared in the report class to notify the
aspx page when the report is complete. I made the page auto post back itself
every 2 mins to check whether this event has fired.

The reportcomplete event is fired as intended. I have the handler to capture
this event in asp.net page. I am trying to modify some asp.net server
control properties when this event is fired, but nothing happens. Eg:- I
have my report viewer visible false till then, once this event fires i set
ReportViewer.visible=true but it does not happen.

I guess it is the new thread that is launching this event and not the main
thread, hence my controls are not getting updated properly. What I must to
do launch this event using app Main thread once the report processing is
complete.

In windows controls we can use Invoke and Invoke required to safely access
controls from threads, how is it done in ASP.net?

Your Help will be much appreciated.

Thanks and Regards
Murali
Nov 17 '05 #1
1 1139
I'm totally confused by your question. A Page that posts back to itself is
not the same instance of the Page class with each PostBack. It is rebuilt
from scratch. So there's no way to set off a thread in an instance of a Page
class, and handle the event that is raised by the class that is running in a
spearate thread from a completely new and different instance of a Page
class. In fact, how is a Page class that is brand new and exists for a few
milliseconds going to even listen for the event?

The only way to achieve what you're talking about is to cache a class
somewhere that persists across Page instances and PostBacks, such as Session
State, have that instance call the Thread, and then handle the event raised
by the Thread. Page classes from that Session can then poll the cached
instance of the class to find out whether the event was already fired and
handled.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Muralidharan Ramakrishnan" <ra*******@yahoo.co.uk> wrote in message
news:up**************@tk2msftngp13.phx.gbl...
Hi,

I am trying to run a complex report in my asp.net application. The method
which executes the report runs in a SEPERATE thread from threadpool other
than the main application thread.

The New thread calls a sub called ExecuteReport Which has the following code
Sub ExecuteReport [this sub runs on seperate thread from threadpool]
<do all report tasks>
RaiseEvent ReportComplete
end sub

The Reportcomplete is the event I declared in the report class to notify the aspx page when the report is complete. I made the page auto post back itself every 2 mins to check whether this event has fired.

The reportcomplete event is fired as intended. I have the handler to capture this event in asp.net page. I am trying to modify some asp.net server
control properties when this event is fired, but nothing happens. Eg:- I
have my report viewer visible false till then, once this event fires i set
ReportViewer.visible=true but it does not happen.

I guess it is the new thread that is launching this event and not the main
thread, hence my controls are not getting updated properly. What I must to do launch this event using app Main thread once the report processing is
complete.

In windows controls we can use Invoke and Invoke required to safely access
controls from threads, how is it done in ASP.net?

Your Help will be much appreciated.

Thanks and Regards
Murali

Nov 17 '05 #2

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

Similar topics

1
by: dixp | last post by:
I'm new to writing multithreaded apps and I have a design question. I have a winforms app and a class which has a method that does processing which is time intensive. I want the user to be able...
47
by: mihai | last post by:
What does the standard say about those two? Is any assurance that the use of STL is thread safe? Have a nice day, Mihai.
16
by: Robert Zurer | last post by:
Can anyone suggest the best book or part of a book on this subject. I'm looking for an in-depth treatment with examples in C# TIA Robert Zurer robert@zurer.com
5
by: sarge | last post by:
I would like to know how to perform simple multithreading. I had created a simple form to test out if I was multithreading properly, but got buggy results. Sometime the whole thig would lock up...
9
by: tommy | last post by:
hi, i have found a example for multithreading and asp.net http://www.fawcette.com/vsm/2002_11/magazine/features/chester/ i want to speed up my website ... if my website is starting, they...
2
by: Rich | last post by:
Hello, I have set up a multithreading routine in a Test VB.net proj, and it appears to be working OK in debug mode and I am not using synchronization. Multithreading is a new thing for me, and...
55
by: Sam | last post by:
Hi, I have a serious issue using multithreading. A sample application showing my issue can be downloaded here: http://graphicsxp.free.fr/WindowsApplication11.zip The problem is that I need to...
5
by: sandy82 | last post by:
Whats actuallly multithreading is ... and how threading and multithreading differ . Can any1 guide how multithreading is used on the Web .. i mean a practical scenario in which u use...
2
by: Pradnya Patil | last post by:
hi , I am trying to draw ' html div-tag ' on the screen which will resemble a rectangle through vb.net code. I want it to be drawn faster...so I introduced multithreading using Threadpool. I...
7
by: Ray | last post by:
Hello, Greetings! I'm looking for a solid C++ multithreading book. Can you recommend one? I don't think I've seen a multithreading C++ book that everybody thinks is good (like Effective C++ or...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.