Looking for a hash package

R

Ramon F Herrera

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
 
G

Glen Herrmannsfeldt

Ramon F Herrera said:
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
 
K

Keith Bostic

(e-mail address removed) (Ramon F Herrera) wrote in message (e-mail address removed)>...
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 (e-mail address removed)
Sleepycat Software Inc. keithbosticim (ymsgid)
118 Tower Rd. +1-781-259-3139
Lincoln, MA 01773 http://www.sleepycat.com
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top