Re: Using a data structure with many critical sections

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Kalevet" <Kalevet@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ADBC9210-096F-4BF6-8984-6D6492096718@xxxxxxxxxxxxxxxx

[...]

> I know it is hard to estimate the effect of this method without any actual
> numbers, but as a rule of thumb - do you think a mutual exclusion
> mechanism that requires the use of hundreds or even thousand of kernel
> object is reasonable, or will the price be too high?

Hundreds or thousands of synchronization objects are _not_ reasonable. This
is a waste of system resources [though not prohibitive these days] and is a
huge performance drain because of its impact on CPU caches and memory bus.

You should analyze the problem at a high level as already suggested:
identify blocks of data that must be maintained together; organize your data
for use with lock-free operations, etc.

If none of that works you perhaps need to re-state your problem.

One powerful paradigm is queuing. Often times it is possible to re-organize
"flat" structures that seem to require enormous numbers of locks into
queues. You need locks only to insert and remove elements from a queue, but
not to process elements, and this is just a handful of locks, and you might
be able to use lock-free queues.

S


.



Relevant Pages

  • Re: Newbie question on table design.
    ... The record systems I know used a job queue and locks. ... built on a queues and locking model because that is what we had. ... Synchronizing processes is one way to allow for concurrent access ... These record definition libraries eventually grew ...
    (comp.databases.theory)
  • Re: readahead on directories
    ... fine grained locks. ... The two reasons to use a mutex instead of a spin ... forget about asking for more until the queues empty, ... to drop that client, which would free up some more memory, or it might ...
    (Linux-Kernel)
  • Re: Lock(this): Aufgestaute Aufrufer eliminieren ?
    ... auf TryEnter) keinerlei Überwachung bzw. Administration von Locks ... bzw. Queues. ... Prev by Date: ... Next by Date: ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)