[Python-Dev] mlockall() in Python?

Jesus Cea jcea at jcea.es
Thu Jan 29 13:38:29 CET 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Evgeni Golov wrote:
> I'd like to write a small daemon in Python, which should never be
> swapped out (on Linux, this daemon will be Linux specific, so no need
> in a platform-independent solution).
> 
> In C I'd do:
> #include <sys/mman.h>
> mlockall(MCL_FUTURE);
> //do stuff here
> munlockall();
> 
> Is there anything similar in Python?

I would like things like this added to core python, but since you are
restricting yourself to linux, you can use a (trivial) ctypes wrapper.

- --
Jesus Cea Avion                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
jabber / xmpp:jcea at jabber.org         _/_/    _/_/          _/_/_/_/_/
.                              _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQCVAwUBSYGjQZlgi5GaxT1NAQIUMAP/Tl7SWFgVkeeEdRHbkrtlOX4eERbfny7A
xBkUVO72lPB1XnRxZT0+Vo2ggYh/6IHN6SQriEZZPe9Wwn3cZzirjjAqpdvb70TJ
1BezGtLKsoDp4cf6QqDwfITecMaGjfaNhKvvSvPFzaKlpbjsdQjyGCI0dOvxzY5J
6BUxE2yYJdc=
=N0dO
-----END PGP SIGNATURE-----


More information about the Python-Dev mailing list