dbm concurrency

Erno Kuusela erno-news at erno.iki.fi
Wed Apr 23 18:24:47 CEST 2003


In article <6c492956.0304230623.74b92d7f at posting.google.com>,
haribeau at gmx.de (Clemens Hermann) writes:

| Might this be a problem when the C-program requests read-only access
| while python is writing to the dbm or vice versa? If so, how can this
| be solved?

yes. you should lock the file in both access cases, with shared lock
for readers and exclusive lock for the writer. in lockf terms,
LOCK_SH and LOCK_EX respectively.

  -- erno




More information about the Python-list mailing list