
Matt Hurd wrote:
On Fri, 16 Jul 2004 23:38:43 -0400, Michael Glassford <glassfordm@hotmail.com> wrote:
Matt Hurd wrote:
On Fri, 16 Jul 2004 13:54:32 -0400, Michael Glassford <glassfordm@hotmail.com> wrote:
[big snip]
The mutex taxonomy I have in mind would be: 1. null_mutex elided ops, atomic ops with interlocking
This is a good idea.
Uh oh, I mistyped that in my rush to go riding with my kids and you are agreeing with me....
I think the null mutex should have inc, dec, exchange and whatever as static non-interlocked ops and the other mutexes should have them as static interlocked ops.
That keeps a null mutex to the single threaded case.
Perhaps interlocked ops should live in a multi_thread:: or single_threaded:: struct and the appropriate mutexes should just inherit these interfaces.
That way seems neater as you can still reference the multi_threaded::add(...) and the Mutex::add(...) for the appropriate context sensitive operations.
Actually, all I meant is that I liked the idea of a null mutex (in the context of it being substituted for a real mutex in a single-threaded application). [another snip] Mike