[fpc-pascal] How can I write a multithread program as simple as possible?
XHajT03 at hajny.biz
Tue May 26 19:26:25 CEST 2015
On Tue, May 26, 2015 18:12, Géza Kovacs Géza wrote:
> I read the Wiki about this article, it's looks like very complicated for
> me. :-(
> Can anybody show me a very simple example?
> Below is a code, i would like to run it multithread both under Windows
> and Linux.
> Program Sorting;
> n = 999000;
> data : array [1..n] of integer;
> i, j, t: LongInt;
> for i := 1 to n do
> for i := 1 to n-1 do
> for j:=i+1 to n do
> if data[i]<data[j] then
What exactly shall be processed in parallel ("multithreaded") according to
your expectation? FPC doesn't provide any means for automated splitting
complex task into multiple smaller tasks spawned in parallel threads if
that's what you meant.
More information about the fpc-pascal