I hav a problem with threads.
I have a function which reads data from a Multicast group. All this data is gathered in some buffers. I then need to access the buffer through another function. Once the buffer is accesed, I need to empty those buffers. The Thread is just reading data all the time and putting it into a buffer. I have tried to pause the thread but with no luck.
What / how would be the best way? I have attached some of the code.
Public Sub StartReadThread()
m_thread = New Thread(AddressOf ReadData)
m_thread.IsBackground = True
Private Shared Sub ReadData()
'Do something to recieve data into some Buffer(s)
Public function GetBuffer(mydata() as byte) as byte
dim myBuf as byte()
myBuf = myReadBuf