Shared Memory

Because CAVE applications are multiprocessed, shared memory is used to communicate between processes.

Although calculations can be done in the display processes, for best performance, they should be done in a separate computation process, with the results stored in shared memory.

Shared memory is allocated from an arena. The arena must be created before CAVEInit() is called, so that it will be visible to the display processes. Memory can still be allocated from the arena after CAVEInit().

Functions

void * CAVEMalloc(size_t size)
Returns a pointer to a chunk of shared memory of size bytes.
This memory is allocated from the shared arena created by CAVEConfigure().

CAVEFree(void *p)
Frees shared memory which was allocated by CAVEMalloc().

CAVESetOption(CAVE_SHMEM_SIZE, int size)
Sets the size of the shared arena that CAVEMalloc() will use. The default is 8 MB. This must be called before CAVEConfigure().

void * CAVEUserSharedMemory(int size)
Returns a pointer to a shared memory arena of size bytes. The arena may be passed to amalloc() and afree().


bounce.c - trivial shared memory example


Previous page    Next page

Last modified 15 June 1996.

Dave Pape, pape@evl.uic.edu