El 19/06/2014 16:20, Andrey Semashev escribió:
On Thu, Jun 19, 2014 at 12:56 AM, Ion Gaztañaga
wrote: The problem with the message queue is that it won't work at all in Linux between 32 and 64 bit processes because this message queue is based on process-shared mutex and condition variables and pthread mutex and condition variables provided by glibc are not compatible between 32 and 64 bit processes.
Interesting. Do you think it is possible to use futexes directly to implement this portability? This would be a Linux-specific solution, of course.
Futexes take a int pointer and in Linux int is 32 bits in both 32 and 64 bit processes (I think it uses the LP64 data model). So yes, that would be possible, but quite hard to implement, as futexes are quite tricky. I would accept patches, though ;-) We can also test if using spin_condition/spin_mutex is enough from a performance point of view. Those are implemented with basic atomic operations and waits, but operating in 32 bit integers. That could be portable in all OS if correct alignments are used. Best, Ion