Unix Programming - mlock usage

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > May 2004 > mlock usage





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mlock usage
j0mbolar

2004-05-10, 5:44 pm

say we have a small program that is about 16k
and we want to ensure that the entire thing is in memory
so we use mlock.

mlock expects an address followed by the number of bytes
to ensure in memory. What address should I get that would resemble
the starting address of my program? And should I get the size
of the executable and add that to the starting address for
the len size?

also, what happens with data passed to functions in
shared libraries? is it possible for data passed to
functions in shared libraries to end up in swap, when
using mlock?
David Schwartz

2004-05-10, 5:44 pm

j0mbolar wrote:
> say we have a small program that is about 16k
> and we want to ensure that the entire thing is in memory
> so we use mlock.


Use 'mlockall'.

DS


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com