Hi, 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? TIA & kind regards Evgeni Golov
On Sun, Nov 23, 2008 at 10:44 PM, Evgeni Golov <sargentd@die-welt.net> wrote:
Hi,
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?
Python doesn't wrap those function itself, but maybe some extension modules does (or you could wrap it a second: http://pastebin.com/m3286272c http://pastebin.com/m33ca908d) Also, this list is for development *of* Python, not development *with* Python (one of the most used messages this month).
TIA & kind regards Evgeni Golov
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/ggpolo%40gmail.com
-- -- Guilherme H. Polo Goncalves
-----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@jcea.es - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/ jabber / xmpp:jcea@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-----
participants (3)
-
Evgeni Golov
-
Guilherme Polo
-
Jesus Cea