i need to process a received data from a tcp link.the data are frames of hex string at length of 203 bytes.
i save them at the end of tstringlist
MyList.Add( input );
and from a second thread read the first string and process it and remove firs from the list
procedure TMyThread.Execute;
var str : string;
begin
while not Terminated do
begin
FTermEvent.WaitFor(100);
if not Terminated then
begin
str := MyList[0];
MyList.Delete(0);
//some process
end;
end
end;
The question is , is this thread safe?!
TQueue<string>instead of aTStringList. - Andreas Rejbrand