I have done a fair amount of work implementing realtime threading in lazarus (PreEmpt/Linux), and with a fair amount of testing I feel pretty confident that with the right components/tools, FPC/Lazarus would make an outstanding OSS RT industrial design platform. The code I wrote was intended as proof of concept (ie. A hack job). My next task is to redo everything and structure it correctly this time. However, I am struggling in how I should introduce the Posix PreEmpt threading to FPC RTL. While the synchronization code in TThread is somewhat useful, the Priority aspects were clearly written windows specific. Also, even though TThreads were implemented on other platforms, the implementation is certainly not ideal from a Posix Threads standpoint.
For compatibility concerns, should I just leave TThread alone and create a TPThread class and start from a clean slate, or do you think I should keep everything derived from TThread?