469,277 Members | 2,131 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,277 developers. It's quick & easy.

Looking for a hash package

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
Nov 13 '05 #1
2 1919

"Ramon F Herrera" <ra***@conexus.net> wrote in message
news:c9*************************@posting.google.co m...
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


Nov 13 '05 #2
am**@conexus.net (Ramon F Herrera) wrote in message news:<c9bc36ff.0307112300.d6
fa***@posting.google.com>...
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 bo****@sleepycat.com
Sleepycat Software Inc. keithbosticim (ymsgid)
118 Tower Rd. +1-781-259-3139
Lincoln, MA 01773 http://www.sleepycat.com
Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Norman Ackroyd | last post: by
8 posts views Thread by Michael B Allen | last post: by
4 posts views Thread by Thomas Christmann | last post: by
139 posts views Thread by ravi | last post: by
24 posts views Thread by Alexander Mahone | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.