Looking for a hash package

Discussion in 'C Programming' started by Ramon F Herrera, Jul 12, 2003.

  1. Hello:

    Is there some C hash package out there?

    I am a big fan of the Berkeley DB, which has
    outstanding performance, but it is (I think) restricted
    to disk operations, while I would like to keep my data in RAM.
    I need some sort of Perl-like relational arrays, but in C.

    TIA,

    -Ramon F. Herrera
     
    Ramon F Herrera, Jul 12, 2003
    #1
    1. Advertising

  2. "Ramon F Herrera" <> wrote in message
    news:...
    > Hello:
    >
    > Is there some C hash package out there?
    >
    > I am a big fan of the Berkeley DB, which has
    > outstanding performance, but it is (I think) restricted
    > to disk operations, while I would like to keep my data in RAM.
    > I need some sort of Perl-like relational arrays, but in C.


    The hsearch() package is included in many unix systems, and should be
    available in source form from an open source unix implementation.

    Though it has the disadvantage that you can only have one, as the hash table
    is global.

    -- glen
     
    Glen Herrmannsfeldt, Jul 12, 2003
    #2
    1. Advertising

  3. Ramon F Herrera

    Keith Bostic Guest

    (Ramon F Herrera) wrote in message news:<c9bc36ff.0307112300.d6
    >...
    > Hello:
    >
    > Is there some C hash package out there?
    >
    > I am a big fan of the Berkeley DB, which has
    > outstanding performance, but it is (I think) restricted
    > to disk operations, while I would like to keep my data in RAM.
    > I need some sort of Perl-like relational arrays, but in C.


    If you don't specify a physical file name to the Berkeley DB
    Db.open method, DB will create an in-memory database. The
    contents of an in-memory database are not preserved on disk.

    Berkeley DB won't write the contents of any database to disk
    unless the data won't fit in the cache, that is, all data is
    be held in RAM until there is no longer sufficient RAM to hold
    the data. In the case of in-memory databases, running out of
    RAM usually implies the creation of a temporary backing files.

    In the upcoming Berkeley DB 4.2.XX release, applications can
    specify a maximum size for a database, and also that DB fail
    operations rather than opening backing temporary files for
    in-memory databases.

    While there are interesting algorithms for pure in-memory
    databases, a cache in front of a traditional disk-based
    database is usually fine from a performance standpoint.

    Regards,
    --keith

    =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
    Keith Bostic
    Sleepycat Software Inc. keithbosticim (ymsgid)
    118 Tower Rd. +1-781-259-3139
    Lincoln, MA 01773 http://www.sleepycat.com
     
    Keith Bostic, Jul 12, 2003
    #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. Parvinder
    Replies:
    6
    Views:
    749
    Thomas G. Marshall
    Feb 27, 2005
  2. Dave
    Replies:
    2
    Views:
    471
  3. George P
    Replies:
    3
    Views:
    685
    Alex Martelli
    Sep 11, 2004
  4. rp
    Replies:
    1
    Views:
    539
    red floyd
    Nov 10, 2011
  5. Srijayanth Sridhar
    Replies:
    19
    Views:
    627
    David A. Black
    Jul 2, 2008
Loading...

Share This Page