Thread safety

6 views
Skip to first unread message

Yarek Kowalik

unread,
Dec 31, 2008, 12:24:58 PM12/31/08
to montezuma-dev
I'm about to start using montezuma, and would like to get some
guidance on the thread safety. Here are my questions:

- Can montezuma handle multiple readers safely?

- How about updates to the store: does that require any locking?

- Is it OK to have multiple writers or is preferable to have a single
writer?

- Can readers and writers co-exist, or does the writer require an
exclusive access to the store?

Many thanks in advance for all the answers!

Yarek

John Wiseman

unread,
Dec 31, 2008, 7:12:06 PM12/31/08
to montez...@googlegroups.com

Montezuma currently has no support for multithreaded or multiprocess
access to the index. I think multiple readers should be OK, though.


John

Yarek Kowalik

unread,
Jan 2, 2009, 3:12:31 PM1/2/09
to montezuma-dev
What might happen if a writer is writing while a reader is reading
from the store? If it's only that I would be getting incomplete
results, then I can live with that if the next read would be
complete. Otherwise, I can write appropriate locking around reading/
writing, at some performance loss. Is locking necessary you think?

Please advise.

Thanks,

Yarek

Yarek Kowalik

unread,
Jan 12, 2009, 8:14:17 PM1/12/09
to montezuma-dev
>  I think multiple readers should be OK, though.

What about then the optimize-index is being run? I'm guessing reading
is not safe then.

Yarek

Leslie P. Polzer

unread,
Jan 13, 2009, 3:13:30 AM1/13/09
to montez...@googlegroups.com

>>  I think multiple readers should be OK, though.
>
> What about then the optimize-index is being run? I'm guessing reading
> is not safe then.

My rough guess is that you should lock both reads and writes;
a read may flush pending writes if I got that correctly from the
code.

Reply all
Reply to author
Forward
0 new messages