473,385 Members | 1,736 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,385 software developers and data experts.

Problem with spawning new thread in ASP.NEt

n#
I have a long running task to be called from an aspx page.

My code segment

Dim ts As ThreadStart = New ThreadStart(AddressOf runLRProcessAsync)
Dim workerThread As Thread = New Thread(ts)
workerThread.Name = "LRProcess1"
workerThread.Start()
Response.Redirect("LRProcessResult.aspx?Refresh=N)
Everything works fine when the long running process is really a time
consuming operation.
But in some cases when the long running process is not really that
long, my response.redirect never gets executed.
I introduced aritifical slow downs by using Thread.Sleep. But of no
use.

Please help me.

Dec 18 '06 #1
2 1324
Hi,
just try this one:
Response.Redirect("LRProcessResult.aspx?Refresh=N" ,True)

Thanks and Regards,
Manish Bafna.
MCP and MCTS.
"n#" wrote:
I have a long running task to be called from an aspx page.

My code segment

Dim ts As ThreadStart = New ThreadStart(AddressOf runLRProcessAsync)
Dim workerThread As Thread = New Thread(ts)
workerThread.Name = "LRProcess1"
workerThread.Start()
Response.Redirect("LRProcessResult.aspx?Refresh=N)
Everything works fine when the long running process is really a time
consuming operation.
But in some cases when the long running process is not really that
long, my response.redirect never gets executed.
I introduced aritifical slow downs by using Thread.Sleep. But of no
use.

Please help me.

Dec 18 '06 #2
n#
Actually i got the ThreadAbort Exception, but when I tried

Response.Redirect(url, false);
HttpContext.Current.ApplicationInstance.CompleteRe quest();

Still my page freezes.

Manish Bafna wrote:
Hi,
just try this one:
Response.Redirect("LRProcessResult.aspx?Refresh=N" ,True)

Thanks and Regards,
Manish Bafna.
MCP and MCTS.
"n#" wrote:
I have a long running task to be called from an aspx page.

My code segment

Dim ts As ThreadStart = New ThreadStart(AddressOf runLRProcessAsync)
Dim workerThread As Thread = New Thread(ts)
workerThread.Name = "LRProcess1"
workerThread.Start()
Response.Redirect("LRProcessResult.aspx?Refresh=N)
Everything works fine when the long running process is really a time
consuming operation.
But in some cases when the long running process is not really that
long, my response.redirect never gets executed.
I introduced aritifical slow downs by using Thread.Sleep. But of no
use.

Please help me.
Dec 19 '06 #3

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

Similar topics

1
by: ruben barzallo via .NET 247 | last post by:
(Type your message here) Hi, I have a Windows Service and works very good. This "service" use a TcpListener. Everything ok. But, when the event is executed stop, the program must close the...
2
by: Dave Kirby | last post by:
I am working on a network management program written in python that has multiple threads (typically 20+) spawning subprocesses which are used to communicate with other systems on the network. This...
2
by: Mike | last post by:
Hi ! I need to spawn several threads in a loop. The exact number is a user defined parameter. for(int i = 0; I < NUMBER_OF THREADS; i++) { // Spawn a new thread that does something } I am...
1
by: Russ Green | last post by:
I hav previosuly had VB.NET 2003 Standard installed on my machine and it works great. Yesterday I installed C++.NET 2003 Standard and starting playing with it. Hardly surprisingly it also worked...
1
by: Sanjay Kedare | last post by:
Hi, How safe it is to spawn a thread to do some routine job from Application_Start event of ASP.NET Also whenever the ASPNET worker process restarts, will the Application_Start event be...
0
by: Allan Ebdrup | last post by:
I'm inside a function where I have a static cache, when the cache needs to be updated I want to do it asyncronously, because updating the cache takes a while. I want to use thread safety when...
0
by: Nico Kruger | last post by:
I want to execute a command (in this case, and it seems to be significant, a Java program) in a thread in Python. When I execute the java binary in the main python thread, everything runs...
12
by: bhunter | last post by:
Hi, I've used subprocess with 2.4 several times to execute a process, wait for it to finish, and then look at its output. Now I want to spawn the process separately, later check to see if it's...
1
by: Mike | last post by:
Hi All, I'm using vb.net as my codebehind lang. and the following code is being executed in my aspx.vb page to stamp a DB row. Dim oStatsInfo As New StatsInfo(CartID, Batch, Set, Num, 0, 0, 0,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.