I have a vb.net windows form which generates report that is displayed using crystal report (backend is sql server database tables). Once the report is generated and shown a procedure updates the contents of the report on to a table. This update process takes around a minute. This update process freezes the report window and the cursor gets stuck till the update process is complete.
So I moved the code from the update procedure to a class and invoked it as a thread. The report is accessible immediately on display and the update process runs in background.
Dim urctThread As Thread
Dim csURCT As ClassURCT = New ClassUpdateRCT()
urctThread = New Thread(New ThreadStart(AddressOf csURCT.URCT))
urctThread.Priority = Threading.ThreadPriority.Lowest
urctThread.IsBackground = True
urctThread.Start()
My question here is, what happens if the user closes the form that invoked the thread. Will the thread terminate or will it continue till execution of the update process is complete.
I am new to threading and a layman in programming (self taught). Would appreciate your valued input here.
Regards.