How to dispose an exe

ryanlcs

Member
Joined
Apr 17, 2008
Messages
12
Programming Experience
Beginner
Hi

I have a program, and there is a timer to run it every 15 minutes. Every time it run, it will create a new exe / thread, (I monitor this thru an external software called TCPView). With the thread growing, it may slow down the performance, is there a way to dispose the thread before a new one is created?

VB.NET:
Private Sub Processing()
        Dim tmrThreadingTimer As Threading.Timer

        Try
            tmrThreadingTimer = New System.Threading.Timer(New System.Threading.TimerCallback(AddressOf tmrThreadingTimer_TimerCallback), Nothing, 0, 9000)
            m_colTimer.Add(tmrThreadingTimer)
        Catch ex As Exception
            EventLog.WriteEntry(STR_LOG_SOURCE_NAME, "Processing:" & ex.Message & " from source " & ex.Source, EventLogEntryType.Error)
        End Try

    End Sub

Thanks.
 
if i remembered well enough,
u dont need to call your thread inside thread.
just after the thread start put thread.sleep(15*60) inside thread procedure to delay this thread for 15 minutes before to starting call own procedure.
 
Back
Top