|
Boost : |
Subject: Re: [boost] Mutexes claim a Windows event handle
From: Christian Holmquist (c.holmquist_at_[hidden])
Date: 2010-06-01 15:11:24
>
> > > >
> > > > Why do you need so many mutexes?
> > >
> > > Yeah, as a threading non-expert but somewhat educated bystander, what
> > > Richard described smells like a design with many locks at object
> > > granularity, which is almost always a mistake. Have you considered
> > > revisiting the architecture?
> > >
> > > --
> > >
> >
> >
> > What is the alternative to placing the mutex at object level? Having some
> > kind of mutex pool?
>
> at object level != object granularity
>
> By the latter I mean a system where every object has its own mutex,
> without regard to the invariants *between* objects in the system that
> must be protected.
>
> --
>
I re-read the original post and see what you mean:
" The problem is that I must support 100,000 objects containg multiple
mutexes "
^^^^^^^^
Indeed, that'll lead to more problems than the waste of resources.
/ Christian
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk