Ralph et al,

> first of all let me say thank you for this fantastic piece of
> software.

You're welcome, it's nice to hear that.  I gather it's worked well (and
fast and small) for your needs.  (I was one of the developers at HP.)

> I have a question.  I'd like to use the library as a foundation for a
> high performance multithreaded app.  I would like to know if the
> library is thread-safe and if it performs any kind of locking for the
> basic operations (insertion, replacemente etc.).  I've read in a
> previous post in this mailing list something about locking the whole
> tree, but since my application will have heavy read/write concurrency,
> it's not really an option for me.

Yes it is.  Look for the thread measurement example program that I
believe is in the Judy package, and play with it.  You'll probably
discover, as we did, that the overhead to thread lock/unlock overwhelms
the time required, on average, in Judy calls themselves.  If something
is small and fast enough, treat it as atomic, at least initially.

Judy is not thread-safe as written, but only because it calls malloc().
Is there such a thing as a thread-safe malloc()?  If you used that, and
ensured separate threads didn't share the same Judy arrays, you'd be OK.
If you need to share the memory, just lock/unlock each array access as
appropriate.  (Single write lock blocks all readers/writers?)

Cheers,
Alan Silverstein

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Judy-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/judy-devel

Reply via email to