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
>
>

i'm not sure how you would get something a whole lot more efficient than
nsv's if the infrequent updates can happen at any time. you still need
to do a mutex of some sort.

i would make sure the mutexes are actually the bottleneck.

tom jackson's idea of splitting up the nsv's into a set of nsv's
seems like a good idea to me id' try that first it is easy for you to do..


--
     Mike Hoegeman
     Email: [EMAIL PROTECTED]
     Phone: 805-279-7306

Reply via email to