Re: Using a data structure with many critical sections
- From: "Slava M. Usov" <stripit.slough@xxxxxxx>
- Date: Tue, 1 Nov 2005 18:12:55 +0100
"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
.
- Prev by Date: Re: Using a data structure with many critical sections
- Next by Date: passing username/passwd between two processes securely...
- Previous by thread: Re: Using a data structure with many critical sections
- Next by thread: Re: Using a data structure with many critical sections
- Index(es):
Relevant Pages
|