[fpc-devel] Parallel Computing

Michael Schnell mschnell at lumino.de
Mon Dec 10 12:54:18 CET 2007


> OpenMP is about lightweight threads. The 'thread events' proposal is
> the opposite: normal threads+events queues. 
Of course you are right here.

IMHO the "parallel" idea is hard to implement, as the compiler needs to 
heavily support it. And it's completely outside of what a user expects 
from a Delphi language compiler. The implications of "parallel" sections 
might be hard to understand to the user of the compiler, especially if 
the language does not implement additional synchronizing methods. 
(Issues: ThreadVars versus normal Vars unprotected normal vars will 
fail, even a normal counter fails with multiple CPUs if the compiler 
does not create a bus lock instruction).

Nonetheless it's a good investment in the future, regarding multiple 
CPUs to become very common (and "light wight" threads in Linux 
supporting this a lot better than the Windows thread model that seems to 
impose a lot more overhead).

OTOH "Event Threads" is just an RTL enhancement and thus it's quite 
easily implemented. And "thread events" only adds a single "procedure of 
thread" keyword or slightly extends the implementation of "procedure of 
object". This should not be to hard to implement either. (Of course the 
user needs to take care of synchronizing issues as well.))

> Both techniques can live
> happily together, so I think, the thread events should get a page of
> its own.
>   
I can do this. But to me it looks like things in a wicki get lost very 
easily as they will only be found if someone explicitly searches for 
that issue. So doing another stand-alone article only makes sense when 
knowing decent locations where to place a link to same.

-Michael



More information about the fpc-devel mailing list