Solved

asp.net threading

Posted on 2012-03-12
2
173 Views
Last Modified: 2012-03-20
I have a long running process.  My plan is to create a page which will execute the process which creates a file.  The page will kick off a thread the return to the user and not wait for it to finish.  The page will have some javascript that will keep pinging the server with a web method.  When the file is created, the webservice will return the url of the file.

1. How can I kick off the thread so that the file is created without waiting for a  callback?  Is there an easy way to kick it off then leave?

2. Is this a good method?  Should I do something else.
0
Comment
Question by:jackjohnson44
2 Comments
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 37712032
How can I kick off the thread so that the file is created without waiting for a  callback?  Is there an easy way to kick it off then leave?
If you create a Thread object within your page, then call its Start method, execution will continue without blocking, unless you call Join at some point.

2. Is this a good method?  Should I do something else.
I guess that depends on whether or not you have structured this such that a subsequent request to the page won't try to write the file whilst another thread is doing so. Have you guaranteed that two threads won't compete with each other?
0
 

Author Comment

by:jackjohnson44
ID: 37714869
Thanks for the response.  I am actually going to pass up a guid and create a file based on that so it should be unique.

a little more info:
I am creating an excel document which could be quite large.  My plan was to load the page which will kick off the process then immediately return to the user and display a "loading" message.  The plan was to keep ping-ing my server using jQuery and search for the file using the name (guid) that I have.  When it finds it, display a link for downloading.  Make sense?
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now