Max number of PRLock objects

View: New views
2 Messages — Rating Filter:   Alert me  

Max number of PRLock objects

by anton kostov :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi guys,

/ I'm sorry if this was posted before me (I've searched but didn't
find the issue). /

Is there a way to directly find the maximum number of PRLock objects
that are available for creation at a certain moment? AFAIK, the only
way to receive that there are no more mutexes available on the system
is to check the return value of PR_NewLock(void), i.e. NULL when "for
example, the lock cannot be created because of resource constraints".

The reason I am asking this is my attempt to optimize synchronization
of a large arrays of structures - i.e. instead of using one PRLock for
the entire array, to use a certain ammount of PRLock's that are
responsible for parts of the array.

Thanks for your responses in advance,
BR, Anton
_______________________________________________
dev-tech-nspr mailing list
dev-tech-nspr@...
https://lists.mozilla.org/listinfo/dev-tech-nspr

Re: Max number of PRLock objects

by Wan-Teh Chang-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, Aug 7, 2008 at 7:09 AM, Anton Kostov <antonkostow@...> wrote:
>
> Is there a way to directly find the maximum number of PRLock objects
> that are available for creation at a certain moment?

I don't know how to do this,  I guess the maximum number
of PRLock objects (or rather, the underlying pthread_mutex_t
or Win32 CRITICAL_SECTION objects) that you can create
is very high.

Wan-Teh
_______________________________________________
dev-tech-nspr mailing list
dev-tech-nspr@...
https://lists.mozilla.org/listinfo/dev-tech-nspr
LightInTheBox - Buy quality products at wholesale price!