ufsstat - testers / feedback wanted!
Jeremie Le Hen
jeremie at le-hen.org
Fri Oct 14 03:32:27 PDT 2005
Hi,
> >I'd be grateful if you could clarify that point for me. Are you saying that
> >if I write
> >
> > long long foo;
> > ...
> > foo++;
> >
> >then the C compiler generates code for 'foo++' which is not thread-safe?
> >(And therefore I would have to protect it with a mutex or critical section)
>
> Yes. On 32-bit it looks something like that:
>
> cltd
> movl $1 %eax
> movl $0, %edx
> addl -16(%ebp), %eax
> adcl -12(%ebp), %edx
> movl %eax, -16(%ebp)
> movl %edx, -12(%ebp)
I'm not sure about it but I bet there are some macro for this kind of
thing in order to use a mutex only when necessary (IOW, on archs that
don't support 64bits natively). Am I right, and in this case what
are those macros ?
Regards,
--
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >
More information about the freebsd-current
mailing list