Jan Kiszka wrote:
Philippe Gerum wrote:
Jan Kiszka wrote:
Hi,
I was wondering if there is already a method in the fusion native
skin to turn the main thread of a process into real-time. Did not
find anything. I guess it would be easy to add such feature to
librtai based on existing syscalls. Should I write a patch? Something
like "rt_task_attach"?
Actually, you can already do this by calling the internal POSIX API
extension: pthread_init_rt(), which is part of the system skin
implicitely attached to a user-space RT app.
Then what about some redefinition for the native skin? Just to have the
API streamlined.
In fact, it can't be a call to pthread_init_rt() as I first suggested,
because the RTAI skin maintains some information locally for each of its
tasks which would not be properly set up by the latter call. So a
wrapper to this call won't do it either. Anyway, crafting the proper
call for the RTAI API should not be a complex issue.
While thinking about this functionality some time ago for the native
RTAI skin, I must admit that I did not find obvious applications of
it, this is why it's not there in the first place. But maybe I'm
wrong. What's the compelling argument for having it?
Porting existing software which assumes that some magic calls exist to
make its main() function hard realtime :-/. Actually, I wouldn't write
new software according to this model. Ok, another argument might be that
this may save one thread if there is no other need for it and resources
are tight.
Ok, fair enough. I'd take the portability argument as the most
compelling one since not having such RT conversion syscall requires to
change the code structure somewhat which is not that user-friendly, even
if the changes are not fundamental.
--
Philippe.