In my ASP.NET application, a while down 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 handled and a response is sent to the client. However, since I never call thread.Abort()
or anything of the like, and I am very inexperienced with threading in ASP.NET, I am worried that I'm opening up for memory leaks or other threading problems.
What happens with the thread I start with the code above after Larma_Thread
finishes running?