Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases > #352 > unrolled thread

Thread safe

Started by"daydreamer" <sundaresh.venugopal@gmail.com>
First post2013-02-14 03:56 +0000
Last post2013-02-15 04:07 +0000
Articles 3 — 2 participants

Back to article view | Back to comp.databases


Contents

  Thread safe "daydreamer" <sundaresh.venugopal@gmail.com> - 2013-02-14 03:56 +0000
    Re: Thread safe Kees Nuyt <k.nuyt@nospam.demon.nl> - 2013-02-14 22:33 +0100
      Re: Thread safe "daydreamer" <sundaresh.venugopal@gmail.com> - 2013-02-15 04:07 +0000

#352 — Thread safe

From"daydreamer" <sundaresh.venugopal@gmail.com>
Date2013-02-14 03:56 +0000
SubjectThread safe
Message-ID<20130214035600392@webuse.net>
I have a tree of recursive small hash tables. A small part of each hash
table is stored in memory and the actual tables, in a file. This is for
a simple experimental hash/trie based database organization.I wish to
make this database thread safe. I intend to do so at the hash table
level, to permit several threads to simultaneously read the hash table,
but only one thread at a time to write or change the hash table. What is
the best way to do accomplish this ? Also what happens if a thread
holding a write
lock on a hash table is abruptly terminated, never releasing that lock,
for other threads to access the table ? 

Posted using www.webuse.net 

[toc] | [next] | [standalone]


#353

FromKees Nuyt <k.nuyt@nospam.demon.nl>
Date2013-02-14 22:33 +0100
Message-ID<cvlqh85e1gitm5hm8aqhoke9a0okhov97a@dim53.demon.nl>
In reply to#352
On Thu, 14 Feb 2013 03:56:00 GMT, "daydreamer"
<sundaresh.venugopal@gmail.com> wrote:

>I have a tree of recursive small hash tables. A small part of each hash
>table is stored in memory and the actual tables, in a file. This is for
>a simple experimental hash/trie based database organization.I wish to
>make this database thread safe. I intend to do so at the hash table
>level, to permit several threads to simultaneously read the hash table,
>but only one thread at a time to write or change the hash table. What is
>the best way to do accomplish this ? Also what happens if a thread
>holding a write
>lock on a hash table is abruptly terminated, never releasing that lock,
>for other threads to access the table ? 

No need to reinvent the wheel, it has been done before.
Use SQLite or Berkely DB.

-- 
Kees Nuyt

[toc] | [prev] | [next] | [standalone]


#354

From"daydreamer" <sundaresh.venugopal@gmail.com>
Date2013-02-15 04:07 +0000
Message-ID<20130215040746392@webuse.net>
In reply to#353
Kees Nuyt <k.nuyt@nospam.demon.nl> wrote:

> On Thu, 14 Feb 2013 03:56:00 GMT, "daydreamer"
> <sundaresh.venugopal@gmail.com> wrote:
> 
> >I have a tree of recursive small hash tables. A small part of each hash
> >table is stored in memory and the actual tables, in a file. This is for
> >a simple experimental hash/trie based database organization.I wish to
> >make this database thread safe. I intend to do so at the hash table
> >level, to permit several threads to simultaneously read the hash table,
> >but only one thread at a time to write or change the hash table. What is
> >the best way to do accomplish this ? Also what happens if a thread
> >holding a write
> >lock on a hash table is abruptly terminated, never releasing that lock,
> >for other threads to access the table ? 
> 
> No need to reinvent the wheel, it has been done before.
> Use SQLite or Berkely DB.
> 
So much for so called freedom. I must be really free I guess, even if it
is only to reinvent a dumb wheel or be a dumber cog in it. Is that even
a valid expression or one thrown around to dissuade free thought ? I'd
rather do things for myself preferably in my own way. BTW, no input
required, I believe I have figured it out myself. Thanks for nothing.

Posted using www.webuse.net 

[toc] | [prev] | [standalone]


Back to top | Article view | comp.databases


csiph-web