[fpc-devel] Threads and alot of crap

Michael Van Canneyt michael at freepascal.org
Mon Oct 16 22:47:34 CEST 2006



On Mon, 16 Oct 2006, Ales Katona wrote:

> I've implemented the semaphores stuff (with a big bad bug, btw thanks
> Jonas for fixing).
> 
> Right now I'm thinking about how to go next.
> 
> The choices I see right now are:
> 
> 1. Basicly just clean the current pthreads implementation, make sure
> types are not redefined in baseunix/unixtypes and pthreads etc. and be
> happy.
> 
> 2. Add proper "interface" style pthreads with chosable (how is a
> question) backend lib (eg: freeBSD has 3 libs to which a pthread
> interface can link).

What do you mean with this ?

> 
> There's also a choice #3 which is a complete threading design overhaul,
> but since that'd break old code I don't even consider it to be an option
> (I actualy do but I know you wouldn't).

If you keep everything working, I don't see why this would be a problem.

> 
> There's also still the hackish NPTL vs processes linux situation in
> TThread 2.4 vs 2.6 kernel. Not sure if it's considered "clean enough"
> now that pipes are gone or if that should be somehow addressed as well.
> 
> If the linux tthread.inc could be cleaned, I'm 100% sure that
> tthread.inc could be merged into one file and put into rtl/unix.

That is the minimum which should be done, IMHO.

In fact, it should go in rtl/objpas and be independent of the OS.
it should only use TThreadManager functions...

When porting to a new OS, only TThreadManager should be implemented
with a suitable implementation. That is why TThreadManager was introduced.

Michael.



More information about the fpc-devel mailing list