In my ASP.NET application, while on the stack, I call the following code:
Public Shared Sub Larma(ByVal personId As Integer) Dim thread As New System.Threading.Thread(New ParametrizedThreadStart(AddressOf Larma_Thread)) thread.Start(personId) End Sub Private Shared Sub Larma_Thread(ByVal personId As Integer) StartaLarm(personId) Thread.Sleep(1000 * 30) StoppaLarm(personId) End Sub
While this thread is running, the rest of the request is processed and the response is sent to the client. However, since I never call thread.Abort() or anything like that, and I am very inexperienced with threads in ASP.NET, I am worried that I am opening a memory leak or other threading issues.
What happens to a thread that starts with the code above after Larma_Thread completes?
Tomas lycken
source share