If there is any possibility, try breaking up you array into several
arrays. Then you can use more than one nsv bucket. Or how do tcl arrays
work? If they use a hashtable as well, then you can use a global array,
can't you?
global copy_array
array set copy_array [nsv_array get main_array]


--Tom Jackson

Sean Owen wrote:
>
> All,
>
> I've got an issue with lock contention using nsvs.
>
> Our site has a huge hash table of categories that is loaded once when the
> server starts, and is modified rarely. It is used frequently throughout the
> site. Currently we're keeping it in an nsv.
>
> The problem is, under heavy load, we get into serious lock contention
> problems reading from it. 99.99% of the time we are just reading, so
> ideally I'd like to use something akin to a read/write lock, however, the
> overhead of an actual rwlock will probably only make matters worse.
>
> The table is far too large (~50,000 entries)to just load up every time an
> interp is initialized.
>
> I contemplated using ns_share, but after reading the source, decided it
> would be even worse. (Much worse).
>
> Any ideas for me? Is there any way to create a shared read-only
> datastructure that doesn't use thread interlocking? Do I need to code my
> datastructure up in C?
>
> Thanks,
> Sean

Reply via email to