is there a way to have a piece of shared memory that could be accessed simultaneously by an external written in Java and another one written in C? Just like one can access from MXJ the data stored in a [buffer~] object (which was created with the C API of Max).
Bonus question: is there a way to define a common mutex that can then be used by both Max and MXJ at the same time to synchronize the access to this shared block of memory?
Since Java normally doesn’t allow you to access memory by address the way C does, this becomes tricky. IMS, it is possible to link your Java code to a "native" method (for instance, something generated by a C-compiler), so that would be the back door.
Still, leehu’s suggestion of abusing a buffer~ as a memory area that you can access both from your [mxj] code and your C-based external might be much easier.
Also, you can bind an arbitrary pointer to a symbol.