Re: Multitasking and containers
- From: "Matthew Heaney" <mheaney@xxxxxxx>
- Date: 28 Nov 2006 11:17:33 -0800
Dmitry A. Kazakov wrote:
Further, even on a single CPU, where protected functions and procedures are
equivalent, the requirement "no task switches while lock held" might be
unacceptable if you hold it for too long.
But this is already a precondition for using a protected object as a
monitor. The RM makes it clear that you shouldn't be doing anything
that takes "too long" inside a protected operation.
Searching a container within a
protected action ... well, one should be a quite strong believer for this.
If this is an associative container then no problem. If this is a
sequence container with many elements, well that's another story.
I wouldn't dismiss it completely, but I definitely don't like it. For
hashes I would at least take one with an external hash function computed
outside the protected action.
The issue with hash tables is not the computation of the hash value,
but rather if the hash function is poor and there are many collisions.
If that's the case then the time to compare the key to items already in
that bucket will be large compared to the cost of computing the hash
value itself.
.
- References:
- Multitasking and containers
- From: Maciej Sobczak
- Re: Multitasking and containers
- From: Dmitry A. Kazakov
- Re: Multitasking and containers
- From: Maciej Sobczak
- Re: Multitasking and containers
- From: Dmitry A. Kazakov
- Re: Multitasking and containers
- From: Matthew Heaney
- Re: Multitasking and containers
- From: Jeffrey R. Carter
- Re: Multitasking and containers
- From: Georg Bauhaus
- Re: Multitasking and containers
- From: Jeffrey R. Carter
- Re: Multitasking and containers
- From: Matthew Heaney
- Re: Multitasking and containers
- From: Dr. Adrian Wrigley
- Re: Multitasking and containers
- From: Matthew Heaney
- Re: Multitasking and containers
- From: Dmitry A. Kazakov
- Re: Multitasking and containers
- From: Matthew Heaney
- Re: Multitasking and containers
- From: Dmitry A. Kazakov
- Multitasking and containers
- Prev by Date: Re: Multitasking and containers
- Next by Date: Re: generic question
- Previous by thread: Re: Multitasking and containers
- Next by thread: Re: Multitasking and containers
- Index(es):
Relevant Pages
|