[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Test atomic operations on SPARC 32-bit

Hi Romain,

> 2017-12-09 0:45 GMT+01:00 Petr Vorel <petr.vorel@gmail.com>:
> > Nice, thanks a lot! I might use kernel implementation, but this is handy.
> > (...)
> > I need threads only, no shmem...
> The lib was designed to support GCC 4.8 (IIRC) and some C++11
> threading on S7 and S8. If that's what you need (except for the Solaris
> bit), it should be directly usable.
You're right. It's much easier to use it than spinlock implementation from Linux kernel.

I test it (in my github fork of) LTP project [1], but unfortunately some tests which heavy
test it fails.

$ ./test09
test09.c:53: INFO: Joining thread 63
test09.c:61: FAIL: Atomic does not have expected value

The tests just get slightly fewer incrementation than it should get (6373821 instead of 6400000).

The implementation in github is for SPARC32, but I adjusted the code to test it on SPARC64
and (of course) it behaves the same.

Any idea what can be wrong?

Kind regards,

[1] https://github.com/pevik/ltp/commit/ec5fe3595e4efd6455a38c580c8a5461f840d96f
[2] https://github.com/pevik/ltp/blob/master/lib/newlib_tests/test09.c

Reply to: