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

Florian Klaempfl florian at freepascal.org
Wed Jul 30 21:37:59 CEST 2008


Marco van de Voort schrieb:
>> Eg only allow the parallel or async keyword (I personally do not care
>> which) on an otherwise normal procedure and then another
>> procedure/keyword isfinished(x)? which checks whether the 'parallel'
>> procedure x has finished. With minimum (ie no) checking for whether the
>> procedure uses global data. It wouldn't be foolproof but would be easily
>> usable, wouldn't it.
> 
> How many of these cases do you already have? Because it is nothing more than
> a threadstart and a thread.waitfor (or some more involved), something like
> 
> procedure something.buttonclick;
> 
> var thr :TSyncthread;
> 
> begin
>   thr:=poolmgr.getblockedthread; // get a thread from the pool.
>   thr.proc:=@someprocedure;
>   thr.run
>   <do other stuff>
>   thr.waitforsignal; // also returns to pool.
> end;
> 
> You could define a helper even for the first three lines.

This is wrong. Asynchronous means that the procedure call is put into a 
queue and not immediatly handled if no thread is in the pool. Further, 
your code doesn't handle efficient parameter passing. Especially this 
needs compiler support.



More information about the fpc-devel mailing list