[fpc-devel] Russian locale information not compatible with FPClocale variables

Michael Schnell mschnell at lumino.de
Thu Jul 31 11:01:32 CEST 2008


> then another
> procedure/keyword isfinished(x)? which checks whether the 'parallel'
> procedure x has finished. 
This is what they do with with the "future" keyword, which I find very 
appropriate here.
-> http://wiki.remobjects.com/wiki/Futures

If we would restrict an implementation to parallelizing of complete 
procedures the syntax would be

var
  f: future Integer:
  n: Integer;

function x(i: Integer);
begin
...
end;


begin
...
  f := x(3)
...
  n := f
..
end.

Thus a "parallel" procedure would always be a function that returns a 
value that implicitly shows its execution state.

Note that the "parallel" keyword is not even necessary here, as the 
"thredenizing" of the procedure is done when calling it (f := x(3) ). 
the "parallel function" keyword _might_ be useful to denote which 
functions can be used with "future" results, but I don't see that the 
function compiling itself needs to know.

The execution waits for the thread to be ready when reading the value of f.
At this point there are three possibilities:
 - thread already done: just use the value
 - thread not yet started: the procedure is just called in place.
 - thread still running: wait until ready

BTW there might be a huge difference between a future array of values 
and an array of future values: last would allow for a big number of 
threads to be spawned.

-Michael



More information about the fpc-devel mailing list