O
oopsatwork
Ok...so, I have been outside of the C world for a _very_ long
time...but not so long as to remember how to do multidimensional
arrays. So, let me state that I know how to malloc pointers to
pointers and then malloc my data space. This question is NOT about
that.
I need to keep a dynamically sized (a result of command line options)
matrix in a shared memory segment created via shmget and attached via
shmat. My first instinct was to do what I would do if I were using
malloc. However, the docs for shm.h tell me that it is not safe to
share my pointers, as the shared memory may be attached at a different
point on different processes. So, my question is, whether or not
there is a "standard", or at least common, way of doing shared
multidimensional arrays. I could always "simulate" a multidimensional
array in a single dim. array, but that seems less than ideal. Any
thoughts?
Thanks,
-mike
time...but not so long as to remember how to do multidimensional
arrays. So, let me state that I know how to malloc pointers to
pointers and then malloc my data space. This question is NOT about
that.
I need to keep a dynamically sized (a result of command line options)
matrix in a shared memory segment created via shmget and attached via
shmat. My first instinct was to do what I would do if I were using
malloc. However, the docs for shm.h tell me that it is not safe to
share my pointers, as the shared memory may be attached at a different
point on different processes. So, my question is, whether or not
there is a "standard", or at least common, way of doing shared
multidimensional arrays. I could always "simulate" a multidimensional
array in a single dim. array, but that seems less than ideal. Any
thoughts?
Thanks,
-mike