realtime and swapping

Hi,

QNX4 didn’t use swapping because it is unsuitable for realtime apps.
What’s now in RTP? I found a swap file. Is it only for compatibility
with linux apps?
Can (shall) I switch swapping of for realtime apps?

TIA

Friedhelm Schuetz
H.Kleinknecht & Co. GmbH

Hi there,
Swapping by default is disabled for all app. You have to take
special steps to enable it. It is there mostly for gcc, as it
needs a lot of memory to run.

-Peter

Friedhelm Schuetz <Friedhelm.Schuetz@kleinknecht.de> wrote:

Hi,

QNX4 didn’t use swapping because it is unsuitable for realtime apps.
What’s now in RTP? I found a swap file. Is it only for compatibility
with linux apps?
Can (shall) I switch swapping of for realtime apps?

TIA

Friedhelm Schuetz
H.Kleinknecht & Co. GmbH

Hi all,

pgraves@qnx.com wrote:

Hi there,
Swapping by default is disabled for all app. You have to take
special steps to enable it.

Which are the steps?
I had not found something in the docs.


Michael

Michael Tasche <michael.tasche@esd-electronics.com> wrote:

Hi all,

pgraves@qnx.com > wrote:

Hi there,
Swapping by default is disabled for all app. You have to take
special steps to enable it.

Which are the steps?
I had not found something in the docs.

You have to unlock you memory with a call to munlockall(). This
will enable swapping for you, but I don’t think this is really
recommented yet, as the swapping is still fairly new and only
guaranteed to work with gcc and friends.

-Peter

pgraves@qnx.com wrote in message <8smqgg$mqa$1@nntp.qnx.com>…

You have to unlock you memory with a call to munlockall(). This
will enable swapping for you, but I don’t think this is really
recommented yet, as the swapping is still fairly new and only
guaranteed to work with gcc and friends.

Does this mean that all new processes will start with their memory locked in
physical
memory? I was trying to use the “mlock” function as recommended in the “how
to write
an interrupt handler” docs, but my app would error out with “unimplemented
function”.

What’s the “correct” way to deal with this situation?

“Kees Cook” <cook@cpoint.net> wrote in message
news:98qcg2$n2r$1@inn.qnx.com

pgraves@qnx.com > wrote in message <8smqgg$mqa$> 1@nntp.qnx.com> >…
You have to unlock you memory with a call to munlockall(). This
will enable swapping for you, but I don’t think this is really
recommented yet, as the swapping is still fairly new and only
guaranteed to work with gcc and friends.


Does this mean that all new processes will start with their memory locked
in
physical memory?

Yes

I was trying to use the “mlock” function as recommended in the “how
to write
an interrupt handler” docs, but my app would error out with “unimplemented
function”.

What’s the “correct” way to deal with this situation?

I did a quick test with your app and another that just does a bunch
of malloc’s and it does not look like the munlockall() will persist
across an exec. Posix says memory locks should not persist across
an exec, so the same should be true of unlocks I believe.

-Peter

Superuser <n2kra@orn.com> wrote:

—559023410-2078917053-984963182=:2678821
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII

As am experiment I wrote the following:

swap.c attached

so I can try - swap prog args

that assumes that munlockall() persists across an exec()

beside watching the output of swapctl, is there any other way
I can verify that a program’s pages are unlocked ???

Previously, > pgraves@qnx.com > wrote in qdn.public.qnxrtp.os:
Michael Tasche <> michael.tasche@esd-electronics.com> > wrote:
Hi all,

pgraves@qnx.com > wrote:

Hi there,
Swapping by default is disabled for all app. You have to take
special steps to enable it.

Which are the steps?
I had not found something in the docs.


You have to unlock you memory with a call to munlockall(). This
will enable swapping for you, but I don’t think this is really
recommented yet, as the swapping is still fairly new and only
guaranteed to work with gcc and friends.

-Peter