Support for 32-bit hardware platforms? #1769
Replies: 2 comments 12 replies
Actually there is no other strong reason and 2 years ago we ported iceoryx to 32-bit and it was running with the atomic restriction. But we did not pursued it any further since we had no use case at that time.
We require lock-free algorithms to ensure a thread-safe access to the shared-memory constructs. We decided against mutexs since it is possible that an application dies while holding a lock and a mutex can only be unlocked by the owner. Such a case would then lead to a total deadlock of the whole system. Usually we use 64-bit in a way that 32-bit are some kind of index and the remaining 32-bit are an aba counter. But in most cases we could reduce the index and aba size. The lock-free algorithms are then maybe less safe but for a first shot it would be fine.
You are right and we decided against them. The main reason is serialization and a memory layout which is platform independent. Just think of the problem one encounters when serializing a As solution I would introduce a little helper in iceoryx_platform which performs a conditional
This is weird and has to be investigated further. I think if we want to make 32-bit fly we require a CI target for this. As soon as I have time I would dig into it but only if you are not digging faster ;) |
|
@elBoberido @elfenpiff So, I managed to persuade the compiler to stop producing warnings with Do you guys want it? I think it makes the code a bit more correct, but at the cost of more template magic... |
Uh oh!
There was an error while loading. Please reload this page.
I understand that officially, iceoryx only supports 64-bit hardware platforms. I know about the requirement that the platform supports lock-free 64-bit atomics.
In our experiments, we commented out the 64-bit atomics check (https://github.com/eclipse-iceoryx/iceoryx/blob/master/iceoryx_hoofs/source/concurrent/loffli.cpp#L32) and we then we can actually build for 32-bit platforms. Furthermore, iceoryx seems to run correctly, as far as our testing goes (which isnt too far at all).
However, we get a ton of compiler warnings. However, these are just two types:
uint64_tfor the template parameter, for example theiox::cxx::vectorclass declaration looks as:template <typename T, uint64_t Capacity> class vector. Furthermore, for example even the index operator ofiox::cxx::vectortakes auint64_tparameter. But, in C++, AFAIK, indices are eitherstd::size_torstd::ptrdiff_t, which are 32-bit integers on 32-bit integers platforms. The compiler doesnt like that.iox::cxx::variant, somehow it cannot recognize that thereinterpret_casts there are fine because of thealignasspecifier. Not sure why it works fine on 64-bit platforms and doesnt on 32-bit platforms, actually.Of course, we could just disable these warnings and go about our day. But I was wondering whether there are any concerns, ideas or comments about this?
For context, we are using gcc 10.2 for the compilation. And iceoryx release v2.0.2.
All reactions