apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: [MAINTAINER] devel/apr-gdbm-db42: apr-util 1.3.7 breaks dbd support
Date Wed, 10 Jun 2009 01:00:37 GMT
Bojan Smojver wrote:
> On Tue, 2009-06-09 at 10:58 -0500, William A. Rowe, Jr. wrote:
>> You are not missing anything, and solutions are welcomed.
> 
> I'm not sure that I'm addressing the right problem here. So, limit
> yourself to rocks of no more than 2kg when throwing.

:)

> Obviously, there is no guarantee that int's are atomic, so this patch
> as-is is bogus. However, we have an atomic API in APR, so we can replace
> the int's with apr_uint32_t, use that API to increment/decrement the
> variables and also initialise it from apr_initialize() function, which
> would then make sure it is available.
> 
> Complete nonsense?

No; this looks to be a very reasonable solution, depending on n++ is
implemented in assembly code.  Also remember in smp you might have two
cpus potentially executing the code in lockstep.

That said, this looks to significantly narrow the race, so +1 for 1.x!

Mime
View raw message