Daniël Mantione schrieb:
Yes, but in a multi-cpu system giving up the timeslice is a very bad idea, because the lock might be released a few clock cycles later by the other cpu; you would waste the rest of time slice while you could be crunching.
IMO the default implementation should work on every architecture. When somebody has really time critical tasks, he has to choose a decent architecture (machine and OS), and optimize his code for that platform.
For everydays computing background-threads are perfectly sufficient, and these can even be "inlined" when a platform does not provide thread support at all. Nobody expects that his number-crunching software will run on an ZX-81 as well as on a Cray, and the same IMO applies to other perfomance-critical requirements.
Threads IMO are the best platform-independent solution, when it comes to the use of the actually available resources on nowadays processors, with possibly more than one core. Then the OS can distribute the load on the available cores - and for that purpose it *must* provide the required synchronization features. If not, then the user did something wrong in the configuration of his machine, and he cannot expect that FPC gets out of it more than he has put in.
DoDi _______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/mailman/listinfo/fpc-devel
