Re: Multitasking and containers
- From: Matthew Heaney <matthewjheaney@xxxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 02:19:55 GMT
"Dr. Adrian Wrigley" <amtw@xxxxxxxxxxxxxxxxxxxxxxxxxxx> writes:
Actually, I think Dmitry's view is largely valid in practice, if
somewhat extreme.
But we were talking specifically about using a protected object to implement a
multiple readers schema vs. using a protected object to implement a Hoare-style
monitor. Because reads must by synchronized, the standard container library
requires a monitor-style synchronization scheme.
The OP made the argument that this isn't very efficient, and Dmitry responded
by saying, "well of course systems require custom hand-made solutions." But the
premise is all wrong, so what Dmitry said is irrelevant. The OP (not Dmitry)
seems to be confused (he was asking the question, after all) about the
difference between a mutex and a monitor. He (the OP) probably doesn't
understand that monitor-type synchronization executes on the current thread, so
there's no context switch, and so there's no efficiency loss.
The only time when monitor-style synchronization would be inappropriate is if
the protected operation needed to make a "potentially-blocking call," but
that's not the case here so there's no reason (certainly there's no efficiency
reason) not to use a monitor.
.
- Follow-Ups:
- Re: Multitasking and containers
- From: Dmitry A. Kazakov
- Re: Multitasking and containers
- 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
- Multitasking and containers
- Prev by Date: Re: How to use associative arrays in Ada 2005?
- Next by Date: Re: How to use associative arrays in Ada 2005?
- Previous by thread: Re: Multitasking and containers
- Next by thread: Re: Multitasking and containers
- Index(es):