Boost logo

Boost :

Subject: Re: [boost] [spirt] question regarding BOOST_SPIRIT_THREADSAFEandBOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2008-09-05 15:58:10


On Fri, Aug 29, 2008 at 10:17 AM, Robert Ramey <ramey_at_[hidden]> wrote:

> > We have a similar requirement for a static library of factories for
> > serialisation (in our case for O/RM, but the principle is the same)
> > and when I put all of this together it seemed that the only way to do it
> > reliably was to use a read/write mutex around accesses to the static
> > data. This way most of the reads can still happen in parallel with the
> > very occasional writes taking exclusive control of the structure.
>

[snip]

> It would be possible to make an archive adaptor for which
> could be added to any archive (through multiple derivation)
> which would automate the semaphore aquisition. If all
> your code used these enhanced archives (and you dll
> loading/unloading was similarly enhanced), you could
> "fire and forget" with almost no performance penalty
> as the semaphores would be accessed only once
> per archve open/close rather than for every access.
>

Sorry, if I'm being too late, but I second that request. Why wouldn't the
library provide such an adapter? I would really like to see the library
that "just works" (tm), out of box. If not with configuration macros, but at
least with a specific toolset. I am sure there are cases where performance
matters less than thread safety and plugin support.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk