Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev

mlockall() in Python?

 

 

Python dev RSS feed   Index | Next | Previous | View Threaded


sargentd at die-welt

Nov 23, 2008, 4:44 PM

Post #1 of 3 (825 views)
Permalink
mlockall() in Python?

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

_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


ggpolo at gmail

Nov 23, 2008, 5:31 PM

Post #2 of 3 (787 views)
Permalink
Re: mlockall() in Python? [In reply to]

On Sun, Nov 23, 2008 at 10:44 PM, Evgeni Golov <sargentd [at] die-welt> 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 [at] python
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: http://mail.python.org/mailman/options/python-dev/ggpolo%40gmail.com
>



--
-- Guilherme H. Polo Goncalves
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com


jcea at jcea

Jan 29, 2009, 4:38 AM

Post #3 of 3 (645 views)
Permalink
Re: mlockall() in Python? [In reply to]

-----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 - http://www.jcea.es/ _/_/ _/_/ _/_/ _/_/ _/_/
jabber / xmpp:jcea [at] jabber _/_/ _/_/ _/_/_/_/_/
. _/_/ _/_/ _/_/ _/_/ _/_/
"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-----
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Python dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.