Re: B+Tree and Memory Mapped Files

Discussion in 'C++' started by Thomas Matthews, Apr 2, 2004.

  1. ccrabfo wrote:

    > Has anyone implemented a memory mapped B+Tree index file system in C++ ? If
    > you have, I'd love to discuss implementation techniques and approaches.
    >
    > ~ thanks
    >
    >


    Yes, I've tried implementing a B+Tree index file system.
    I don't really understand what you mean by memory-mapped though,
    since memory-mapping is beyond the scope of C++.

    Some operating systems allow a file to be treated as memory; others
    allow memory to be treated as a file. Hmmm.

    --
    Thomas Matthews

    C++ newsgroup welcome message:
    http://www.slack.net/~shiva/welcome.txt
    C++ Faq: http://www.parashift.com/c -faq-lite
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.raos.demon.uk/acllc-c /faq.html
    Other sites:
    http://www.josuttis.com -- C++ STL Library book
     
    Thomas Matthews, Apr 2, 2004
    #1
    1. Advertising

  2. Thomas Matthews

    Evan Carew Guest

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

    Well, "mmap", a POSIX.1b standard call has the following in its man page:

    The mmap function asks to map length bytes starting at offset offset
    from the file (or other object) specified by the file descriptor fd into
    memory, preferably at address start. This latter address is a hint
    only, and is usually specified as 0. The actual place where the
    object is mapped is returned by mmap, and is never 0.


    I have in the past used this call to create a 20Mb file, mapped into
    memory, which I then use with placement syntax with a STL library
    container such as a map. This then allows me to put in my program a
    large construct (or many such constructs) which I wouldn't otherwise
    want in my main memory.

    Evan

    Thomas Matthews wrote:
    >
    > Yes, I've tried implementing a B+Tree index file system.
    > I don't really understand what you mean by memory-mapped though,
    > since memory-mapping is beyond the scope of C++.
    >
    > Some operating systems allow a file to be treated as memory; others
    > allow memory to be treated as a file. Hmmm.
    >


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.0.6 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFAbYSDoo/Prlj9GScRAguKAJ92hNvts17L/Ezg9trd51qGFFZq2wCfYaGV
    qB5e8tGxn6KjWkU0I7RGcYQ=
    =VNhB
    -----END PGP SIGNATURE-----
     
    Evan Carew, Apr 2, 2004
    #2
    1. Advertising

  3. Evan Carew wrote:
    > -----BEGIN PGP SIGNED MESSAGE-----
    > Hash: SHA1
    >
    > Well, "mmap", a POSIX.1b standard call has the following in its man page:


    OK, but that has nothing to do with C++. And please stop top-posting.
    You might need to review the welcome message and section 5 of the FAQ:

    http://www.slack.net/~shiva/welcome.txt
    http://www.parashift.com/c -faq-lite/

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.
     
    Kevin Goodsell, Apr 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chris
    Replies:
    2
    Views:
    1,851
    Bryan Donaldson
    Feb 19, 2004
  2. Evan Carew

    Re: B+Tree and Memory Mapped Files

    Evan Carew, Apr 1, 2004, in forum: C++
    Replies:
    0
    Views:
    660
    Evan Carew
    Apr 1, 2004
  3. Peter Nolan
    Replies:
    1
    Views:
    657
    Lothar Werzinger
    Oct 8, 2004
  4. Stub

    B tree, B+ tree and B* tree

    Stub, Nov 12, 2003, in forum: C Programming
    Replies:
    3
    Views:
    10,198
  5. Replies:
    3
    Views:
    585
    Dietmar Kuehl
    Feb 23, 2006
Loading...

Share This Page