[fpc-devel] about realtime tasks

Daniël Mantione daniel.mantione at freepascal.org
Wed Jan 18 11:51:52 CET 2006

Op Wed, 18 Jan 2006, schreef Stefan Kisdaroczi:

> Hi,
> im currently testing my pascal-bindings for the Xenomai [1] realtime extension  
> for Linux. Xenomai allows to program hard realtime programs in userspace. 
> Its a normal library used with $linklib.
> Its working so far, but using multiple tasks, there are some strange effects 
> (exceptions,hangs).
> From the freepascal documentation:
> "Although it is not forbidden to do so, it is not recommended to use 
> system-specific threading routines: ..."
> So I do not really wonder about the effects, but I need a way to make this 
> work.
> As far as I understood, I need to include the unit cthreads, which i have 
> done. If i call rt_task_create, the xenomai-library makes a clone() call to 
> create the new task, so this is a system-specific threading routine. It works 
> so far, but...
> When I include cthreads and (manually?) initialize the ThreadManager, would it 
> be ok ? Or do I need to call CreateThread() and in the thread 
> rt_task_shadow(), which makes the current Pascal-created thread a realtime 
> task? Are any system-specific blocking calls a problem?
> Any suggestions? Can be linux specific, as xenomai is for linux only.

Well, the cthreads unit uses libpthread, for which I don't know if it will 
interfere with your xenomai library. If it doesn't it should work without 


More information about the fpc-devel mailing list