[fpc-devel] syncobjs unit

Florian Klaempfl florian at freepascal.org
Mon Nov 27 13:56:00 CET 2006


AleŇ° Katona schrieb:
> One solution is basicly to use a TThreadID kind of thing for all
> arguments and return types. The problems with this are:
> 
> 1. if one OS has multiple threading backends with multiple types, what
> then? (ifdef isn't enough here)
> 
> 2. who is going to check all platforms all usages of ThreadManager and
> fix them? Who is going to test this.

People will cry if things break, that's how OSS works.

> 
> Another solution is to use one "big-enough" type. But one day big-enough
> isn't going to be big enough and it still has problem #2.

It can be increased, but 128 bit is at least (128-64) bit/0.5 bit/year away :)

Example: the transition from 32 bit to 64 bit filepos and size wasn't even
noticed by anybody :)

> 
> In any case it's going to hurt.

Well, it sounds complicated but usually it isn't that bad.
If TThreadID isn't enough, indroduce a new type like TThreadKillResult. For
multiple thread manager on the same target use the biggest type approach.



More information about the fpc-devel mailing list