[fpc-pascal] Semaphores removed from the rtl?
Karoly Balogh (Charlie/SGR)
charlie at scenergy.dfmk.hu
Wed Jul 19 18:58:25 CEST 2017
On Wed, 19 Jul 2017, Anthony Walter wrote:
> Thanks for that bit of information Charlie. I should have searched the
> svn logs.
> It just seems to me like the concept of a semaphore has been well
> established in CS for decades and it's a bit weird to remove them from
> the rtl. They are native to all platforms (I just checked). Sure they we
> not used by any rtl internal functions/objects (in TThread for example),
> but I don't believe that should have been reason enough to get rid of
They weren't implemented for all platforms in our RTL. Among others, using
FPC's Semaphore functions on Windows were resulting in no-ops or Runtime
errors (probably the later, I don't have Windows at hand to verify). This
is what I mean. I'm not saying they were impossible to implement, just
that they never were implemented in FPC RTL, for any platforms except
Unices. And they were never intended to appear in the System unit public
interface either. (Sadly they have, but that's a different story.)
> In other words, just because a one group of developers don't use a tool,
> that shouldn't dictate its removal.
In this case, those tools were incomplete and unfinished. But I am not
arguing against Semaphores as a concept. You are free to implement
Semaphore-alike behavior using CriticalSections for example, which are
implemented on all platforms which support Threading in the FPC RTL.
More information about the fpc-pascal