There is a cyclic buffer that is continuously filled in the background thread. I need to read it once a second and update the UI interface. Questions related to this.
Using async / await to fill the buffer, is this correct?
public async Task ReceiveAsync(CancellationToken ct) { await Task.Run(() => Receive(progressData)); //в Receive() происходит получение пакетов/разбор из сети и запись в цикличный буфер. }Updating the UI once a second, I imagine this: transferring data through
IProgress:IProgress<DTO> progressData = new Progress<DTO>(progressHandler);It seems to me that this method is not entirely correct, it can be read directly from the UI stream, this buffer which is filled in another stream. But then another question, reading and writing at the same time? Will there be any problems with this.
Receive(). - andreycha