[fpc-pascal] How can I write a multithread program as simple as possible?

leledumbo leledumbo_cool at yahoo.co.id
Tue May 26 20:46:33 CEST 2015


> I read the Wiki about this article, it's looks like very complicated for
me. :-( 
> Can anybody show me a very simple example?

Well, it surely is not a beginner's topic. Tell me, if I give:

type
  TMyThread = class(TThread)
    procedure Execute; override;
  end;

procedure TMyThread.Execute;
begin
  WriteLn(i);
end;

begin
  with TMyThread.Create(true) do begin
    FreeOnTerminate := true;
    Start;
  end;
end.

does it make sense to you?



--
View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-can-I-write-a-multithread-program-as-simple-as-possible-tp5721749p5721754.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.



More information about the fpc-pascal mailing list