
Imports System.Threading

Public Module modThreadControl



    '==================================== THREADS   =============================================

    Public Sub subStartThreads()
        Try

            classNewBackground = New classBackground()
            Dim threadBackground As New Thread(AddressOf classNewBackground.subBackgroundMonitor)
            threadBackground.IsBackground = True
            threadBackground.Start()

            Dim API1MainThread As New Thread(AddressOf classAPI1Server.subMain)
            API1MainThread.IsBackground = True
            API1MainThread.Start()

            Dim API2MainThread As New Thread(AddressOf classAPI2Server.subMain)
            API2MainThread.IsBackground = True
            API2MainThread.Start()

            classNewRccClient = New classRccClient()
            Dim RccClientMainThread As New Thread(AddressOf classNewRccClient.subMain)
            RccClientMainThread.IsBackground = True
            RccClientMainThread.Start()

            classNewAddImageToQueue = New classAddImageToQueue()
            Dim AddImageToQueueMainThread As New Thread(AddressOf classNewAddImageToQueue.subGetMoreRecognizedImages)
            AddImageToQueueMainThread.IsBackground = True
            AddImageToQueueMainThread.Start()

            Dim threadUrgVectors As New Thread(AddressOf classGetScanVectors.subGetURGScanVectors)
            threadUrgVectors.IsBackground = True
            threadUrgVectors.Start()

            Dim threadKinectVectors As New Thread(AddressOf classGetScanVectors.subGetKinectScanVectors)
            threadKinectVectors.IsBackground = True
            threadKinectVectors.Start()

        Catch ex As Exception
            frmDebug.subWriteLogs(" EXCEPTION in subStartThreads :  " & ex.ToString)
        End Try
    End Sub



    '==================================== Background  Thread  =============================================
    Dim WithEvents classNewBackground As classBackground

    '==================================== Local RCC Client Thread  =============================================
    Dim WithEvents classNewRccClient As classRccClient

 
    '==================================== Add Image to Queue  =============================================
    Dim WithEvents classNewAddImageToQueue As classAddImageToQueue


  
 
End Module
