Saiful Khan wrote:
> Sorry for late reply. Actualy what I saw that in that application one
> fork() is there, so basically child process is trying to create the thread
> and fails. I removed the fork() and spawned the thread from the main and
> succeed. But the application is so large that, if i remove the fork() then I
> need to change the entire architecture of the application, another big
> task... Can u please tell me what is the alternative of fork()?
>
> Thanks and regards
> Saiful
To quote mlockall manual page: "Memory locks are not inherited by a
child created via fork(2) and are automatically removed (unlocked)
during an execve(2) or when the process terminates."
So, a forked child has to call mlockall to lock its memory.
Beware, however, that calling fork in a real-time application raises
some issues which have been solved recently: only trunk and latest
branch v2.3.x contain the fixes needed to safely call fork in a
real-time application.
--
Gilles Chanteperdrix.
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help