[fpc-pascal] Threading in FPC DOS

Marco van de Voort marcov at stack.nl
Wed Jul 12 11:58:09 CEST 2006

> On 12 jul 2006, at 11:25, Marco van de Voort wrote:
> > I doubt it. Note that it also probably needs enhancing of the
> > threadinterface with a giveuptimeslice functionality, something for  
> > which
> > now sleep(0) is abused.
> sleep(0) is quite bad, because it may not necessarily give up any  
> timeslice. At least very short nanosleeps seem to be implemented as  
> spinning loops on Mac OS X, so maybe sleep(0) is the same.

Do you know a correct way of doing this on *nix?

(it is a hack nevertheless, but a much used one in Delphi code because
Windows guarantees it, the better uses are to emulate blocking I/O, the
worse parts for uh, everything, including updating time on a form)

More information about the fpc-pascal mailing list