Creating a shared heap

For several cooperating tasks to share a heap, one task must first create the heap and flatten it to a stream:

      TSharedMemoryHeap* sharedHeap = new TSharedMemoryHeap(size);
      Flatten(sharedHeap, stream);
This operation doesn't stream the heap memory itself; it only streams the TSharedMemoryHeap object that refers to the heap memory. Every other cooperating task can then resurrect the TSharedMemoryHeap object from the stream:

    Resurrect(mySharedHeap, stream);

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker