By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,302 Members | 3,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,302 IT Pros & Developers. It's quick & easy.

Need an advice with this (multithread)

P: n/a
Hi I need some advice about this situation an how I'm current handling it

I hava a ASP.NET solution that in some point start multiples lenghty
verification agains diferent databases, my big challenge is that the user
click in a button "start process"
and close the explorer windows... and in the backgroud all the required
query are executed, when the user is back, maybe two hours late the process
is finish ..

I currently hadlle this (in a developing enviroment) creating a thread when
the user click the star button and this thread start some news thread for
other operation, and seems to work fine,

I create the thread using just this:

Dim thrMyThread As New System.Threading.Thread(AddressOf ExecuteAfter)

Is this ok?

Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
ASP.NET was not meant for such lengthy operations.
I suggest you have ASP.NET launch an EXE to do this or queue up a windows
service to handle the task. Perhaps a flag can be set in a database when
the process is complete.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Ekempd" <Ek****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
Hi I need some advice about this situation an how I'm current handling it

I hava a ASP.NET solution that in some point start multiples lenghty
verification agains diferent databases, my big challenge is that the user
click in a button "start process"
and close the explorer windows... and in the backgroud all the required
query are executed, when the user is back, maybe two hours late the
process
is finish ..

I currently hadlle this (in a developing enviroment) creating a thread
when
the user click the star button and this thread start some news thread for
other operation, and seems to work fine,

I create the thread using just this:

Dim thrMyThread As New System.Threading.Thread(AddressOf ExecuteAfter)

Is this ok?

Nov 19 '05 #2

P: n/a
> I suggest you have ASP.NET launch an EXE to do this or queue up a windows
launch another process implicitly uses a thread so there is no gain here, in
fact there is more overhead with launching a process than firing a thread to
do the long running query.
Is this ok?
It's ok up to the point where the number of users using the application is
low, otherwise you run the risk of spawning too many threads.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... ASP.NET was not meant for such lengthy operations.
I suggest you have ASP.NET launch an EXE to do this or queue up a windows
service to handle the task. Perhaps a flag can be set in a database when
the process is complete.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Ekempd" <Ek****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
Hi I need some advice about this situation an how I'm current handling it

I hava a ASP.NET solution that in some point start multiples lenghty
verification agains diferent databases, my big challenge is that the user
click in a button "start process"
and close the explorer windows... and in the backgroud all the required
query are executed, when the user is back, maybe two hours late the
process
is finish ..

I currently hadlle this (in a developing enviroment) creating a thread
when
the user click the star button and this thread start some news thread for
other operation, and seems to work fine,

I create the thread using just this:

Dim thrMyThread As New System.Threading.Thread(AddressOf ExecuteAfter)

Is this ok?


Nov 19 '05 #3

P: n/a
ASP.NET threads that run for too long (hours) tend to get orphaned and could
be collected by the garbage collector before they've completed. An EXE is
its own process so I believe it does not have this risk. Windows Services
are also not at risk. This is a matter of using the right tool for the job,
and ASP.NET is not it (in this case.)

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:Os**************@TK2MSFTNGP10.phx.gbl...
I suggest you have ASP.NET launch an EXE to do this or queue up a windows

launch another process implicitly uses a thread so there is no gain here,
in fact there is more overhead with launching a process than firing a
thread to do the long running query.
Is this ok?

It's ok up to the point where the number of users using the application is
low, otherwise you run the risk of spawning too many threads.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
ASP.NET was not meant for such lengthy operations.
I suggest you have ASP.NET launch an EXE to do this or queue up a windows
service to handle the task. Perhaps a flag can be set in a database when
the process is complete.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Ekempd" <Ek****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
Hi I need some advice about this situation an how I'm current handling
it

I hava a ASP.NET solution that in some point start multiples lenghty
verification agains diferent databases, my big challenge is that the
user
click in a button "start process"
and close the explorer windows... and in the backgroud all the required
query are executed, when the user is back, maybe two hours late the
process
is finish ..

I currently hadlle this (in a developing enviroment) creating a thread
when
the user click the star button and this thread start some news thread
for
other operation, and seems to work fine,

I create the thread using just this:

Dim thrMyThread As New System.Threading.Thread(AddressOf ExecuteAfter)

Is this ok?



Nov 19 '05 #4

P: n/a
> ASP.NET threads that run for too long (hours) tend to get orphaned and
could be collected by the garbage collector before they've completed. You are saying that a running thread with live references can be garbage
collected? That is contrary to the garbage collector algorithm, care to
provide an example, or documentation on this?
This is a matter of using the right tool for the job, and ASP.NET is not it
(in this case.) I agree.
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl... ASP.NET threads that run for too long (hours) tend to get orphaned and
could be collected by the garbage collector before they've completed. An
EXE is its own process so I believe it does not have this risk. Windows
Services are also not at risk. This is a matter of using the right tool
for the job, and ASP.NET is not it (in this case.)

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:Os**************@TK2MSFTNGP10.phx.gbl...
I suggest you have ASP.NET launch an EXE to do this or queue up a
windows

launch another process implicitly uses a thread so there is no gain here,
in fact there is more overhead with launching a process than firing a
thread to do the long running query.
Is this ok?

It's ok up to the point where the number of users using the application
is low, otherwise you run the risk of spawning too many threads.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
ASP.NET was not meant for such lengthy operations.
I suggest you have ASP.NET launch an EXE to do this or queue up a
windows service to handle the task. Perhaps a flag can be set in a
database when the process is complete.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Ekempd" <Ek****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
Hi I need some advice about this situation an how I'm current handling
it

I hava a ASP.NET solution that in some point start multiples lenghty
verification agains diferent databases, my big challenge is that the
user
click in a button "start process"
and close the explorer windows... and in the backgroud all the required
query are executed, when the user is back, maybe two hours late the
process
is finish ..

I currently hadlle this (in a developing enviroment) creating a thread
when
the user click the star button and this thread start some news thread
for
other operation, and seems to work fine,

I create the thread using just this:

Dim thrMyThread As New System.Threading.Thread(AddressOf ExecuteAfter)

Is this ok?



Nov 19 '05 #5

P: n/a
A page request owns the thread.
A page request will time-out eventually, orphaning the thread.
I don't have any documentation handy but there was a long discussion on this
topic a while back in here...

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:e6*************@TK2MSFTNGP12.phx.gbl...
ASP.NET threads that run for too long (hours) tend to get orphaned and
could be collected by the garbage collector before they've completed.

You are saying that a running thread with live references can be garbage
collected? That is contrary to the garbage collector algorithm, care to
provide an example, or documentation on this?
This is a matter of using the right tool for the job, and ASP.NET is not
it (in this case.)

I agree.
--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
ASP.NET threads that run for too long (hours) tend to get orphaned and
could be collected by the garbage collector before they've completed. An
EXE is its own process so I believe it does not have this risk. Windows
Services are also not at risk. This is a matter of using the right tool
for the job, and ASP.NET is not it (in this case.)

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:Os**************@TK2MSFTNGP10.phx.gbl...
I suggest you have ASP.NET launch an EXE to do this or queue up a
windows
launch another process implicitly uses a thread so there is no gain
here, in fact there is more overhead with launching a process than
firing a thread to do the long running query.

> Is this ok?
It's ok up to the point where the number of users using the application
is low, otherwise you run the risk of spawning too many threads.

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ http://tinyurl.com/27cok
----------------------------------------------------------
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
ASP.NET was not meant for such lengthy operations.
I suggest you have ASP.NET launch an EXE to do this or queue up a
windows service to handle the task. Perhaps a flag can be set in a
database when the process is complete.

Here's more information on Windows Services:
http://msdn.microsoft.com/library/de...owsService.asp

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

"Ekempd" <Ek****@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
> Hi I need some advice about this situation an how I'm current handling
> it
>
> I hava a ASP.NET solution that in some point start multiples lenghty
> verification agains diferent databases, my big challenge is that the
> user
> click in a button "start process"
> and close the explorer windows... and in the backgroud all the
> required
> query are executed, when the user is back, maybe two hours late the
> process
> is finish ..
>
> I currently hadlle this (in a developing enviroment) creating a thread
> when
> the user click the star button and this thread start some news thread
> for
> other operation, and seems to work fine,
>
> I create the thread using just this:
>
> Dim thrMyThread As New System.Threading.Thread(AddressOf ExecuteAfter)
>
> Is this ok?
>



Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.