Message-ID: Date: Fri, 10 Mar 2006 22:33:25 +0200 From: "Dmitry Adamushko" Subject: Re: [Xenomai-help] Xenomai vs. RTLinux In-Reply-To: <4411B23E.8000300@domain.hid> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7445_23470078.1142022805878" References: <440F5F23.7000703@domain.hid> <44118EDC.2010003@domain.hid> <4411B23E.8000300@domain.hid> List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Webb Cc: xenomai@xenomai.org ------=_Part_7445_23470078.1142022805878 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline [skip-skip-skip] I'm not quite clear on the memory allocation question. Does Xenomai have > the same restriction on allocating memory after a real-time task has been > created? I had been thinking that memory allocation could be done from t= he > linux context, or by a real-time task in secondary mode. As one may issue Linux system calls from real-time tasks (causing a switch to the secondary domain), malloc() ( -> sbrk() system call) or any other memory allocation mechanism like C++'s new() does not make a big difference= . The only additional advice though, is that all pages should be "locked" in the physical memory so to prevent them from being occasionally swapped out. mlockall() with MCL_FUTURE comes in handy to this goal. Of course, the rule remains to be the same as you pointed out, - calling malloc() or most of other linux system calls is not something one would lik= e to do (at least being in good memory) inside time-critical code fragments. > > -Jeff > > _______________________________________________ > Xenomai-help mailing list > Xenomai-help@domain.hid > https://mail.gna.org/listinfo/xenomai-help > -- Best regards, Dmitry Adamushko ------=_Part_7445_23470078.1142022805878 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline

[skip-skip-skip]

I'm not quite clear on the memory allocation question.  Does Xenomai have the same restriction on allocating memory after a real-time task has been created?  I had been thinking that memory allocation could be done from the linux context, or by a real-time task in secondary mode.

As one may issue Linux system calls from real-time tasks (causing a switch to the secondary domain), malloc() ( -> sbrk() system call) or any other memory allocation mechanism like C++'s new() does not make a big difference.
The only additional advice though, is that all pages should be "locked= " in the physical memory so to prevent them from being occasionally swapped out. mlockall() with MCL_FUTURE comes in handy to this goal.

Of course, the rule remains to be the same as you pointed out, - calling malloc() or most of other linux system calls is not something one would like to do (at least being in good memory) inside time-critical code fragments.
 

-= Jeff

_______________________________________________
Xenomai-help= mailing list
Xenomai-help@domain.hid
https://mail.gna.org/li= stinfo/xenomai-help



-- =
Best regards,
Dmitry Adamushko ------=_Part_7445_23470078.1142022805878--