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

Need an advice with this (multithread)

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
5 1345
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
> 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
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
> 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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: dbmethods | last post by:
Could someone give a hint on how to do multithread programming with PHP scripting here? Thanks
0
by: Alice | last post by:
Hello I have four multithread windows applications(vb.net) interacting and running on the same machine(windows 2000 with .net framework 1.0). All of them start a new thread each time Filewatcher's...
0
by: r_obert | last post by:
Hello, I'm trying to create a worker thread for my VC++ program, and was wondering whether I should be linking with the Multithread /MT or Multithread DLL /MD option? I'm not quite sure, in...
3
by: QQ | last post by:
I am new here and got lost on a multithread C++ system source codes Thanks a lot!
23
by: Shalini Joshi | last post by:
Hi, I was trying to find out what exactly is meant by multi-thread safe code/functions etc. I couldn't find relevant information on the web and would appreciate any useful links/information on this...
1
by: Daylor | last post by:
few questions about Delegate in vb.net : do i need to create NEW delegate each time i use invoke ? or i can use the same delegate object when using specific invoke ? and if can use the same...
6
by: jmartin | last post by:
Hi, I have made a multithread version of a program (load a file into database), and with two processors I get the double of time in the multithread than in the process (unithread) version. I...
7
by: AAAAA | last post by:
Hi friends, So that you would use multithread in an application WEB? Thanks Cesar
2
by: yoavmelamed | last post by:
Hi all! I'm trying to run multithread on listview control: for example: i have 10 IP addresses in my list and i want to send ping to the first 3 (at the same time), than to the next 3... and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.