Path: csiph.com!news.mixmin.net!news2.arglkargh.de!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!news.tele.dk!news.tele.dk!small.news.tele.dk!newsgate.cistron.nl!newsgate.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'compiler': 0.05; 'memory.': 0.05; 'source.': 0.05; '"c"': 0.07; 'alternatives': 0.09; 'facilitates': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.10; 'python.': 0.11; 'subject:python': 0.14; '"user': 0.16; '(say': 0.16; 'mmap': 0.16; 'parts.': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'subject:ARM': 0.16; 'memory': 0.17; 'typical': 0.18; 'programmer': 0.18; 'language': 0.19; 'library': 0.20; 'libraries': 0.22; 'suppose': 0.22; 'programming': 0.22; 'header:User-Agent:1': 0.26; '(which': 0.26; 'header:X-Complaints-To:1': 0.26; 'helpful': 0.27; 'processed': 0.27; 'specify': 0.27; 'interface': 0.29; 'subset': 0.29; 'thus,': 0.29; 'fixed': 0.31; 'language.': 0.32; 'source': 0.33; 'facility': 0.33; 'file': 0.34; 'gives': 0.35; 'skip:( 30': 0.35; 'i.e.': 0.35; 'quite': 0.35; 'level': 0.35; 'but': 0.36; 'should': 0.36; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'operating': 0.37; 'received:org': 0.37; 'charset:us-ascii': 0.37; 'things': 0.38; 'easily': 0.39; 'takes': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'received:de': 0.40; 'space': 0.40; 'some': 0.40; 'high': 0.60; 'care': 0.60; 'your': 0.60; 'email addr:gmail.com': 0.62; 'more': 0.63; 'combining': 0.66; 'received:217': 0.66; 'direct': 0.68; 'physical': 0.72; 'compiles': 0.84; 'level"': 0.84; 'memories': 0.84; 'partially': 0.84; 'maybe,': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: dieter Subject: Re: python and ARM memory types Date: Mon, 05 Oct 2015 09:01:50 +0200 References: <62e78153-8a84-4b78-8881-8a891df0d496@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e09c44.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:O4MTAxJRaoovbHUa/TZeC2mvPhM= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1444028521 news.xs4all.nl 23815 [2001:888:2000:d::a6]:56774 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:97399 voxner.dev@gmail.com writes: > ... > But how do I specify (streaming,write-combining,write-back) memory types in python ? Is there a library that I can use ? I am thinking of programming some fixed memory space (say 0x1000_000 - 0x2000_000) as "WC or WT or streaming" using the OS and then try to use the mmap facility in python. Python is quite a high level programming language - i.e. lots of things are out of direct control of the programmer - among others memory management. I suppose you will need an approach that gives you more control over memory use - maybe, write your algorithms partially in the "C" programming language. You might find "cython" helpful to easily combine Python parts and "C" parts. "cython" is a compiler that compiles a source (which can use a subset of Python and a subset of "C") into a "C" source file which is then processed like a typical "C" source. It takes care of a lot of the difficulties at the Python-C interface and, thus, greatly facilitates combining Python and "C" parts. > What set of libraries can I use ? Where should I start ? Fixed memories are discouraged so what kind of alternatives I can use ? Note that modern operating systems virtualize memory. You will need a lot of tricks to be able to use a specific range of physical memory in "user level" processes -- but hopefully, you do not need to control thing of the "physical memory level".