Copyright (c) Hyperion Entertainment and contributors.

Exec Named Memory

From AmigaOS Documentation Wiki
Jump to navigation Jump to search

Introduction

In a multi-tasking environment, it is often desirable to be able to share resources between two more more different Tasks or Processes. This can be done by passing memory pointers, but this is difficult since there is no defined "protocol" for this.

Exec V51 introduces a new concept called named memory. Instead of having to pass a pointer around, you decide on a name for your memory and have others (or yourself) access this memory by it's name. In addition, named memory can be organized into different namespaces. This allows for the same name to exist in different namespaces. All names in the same namespace must be unique.

The resident Namespace

One namespace is predefined with a special functionality: The namespace "resident". This namespace and it's objects will be restored after reboot through ColdStart(). To ensure data integrity, it is possible to have the memory block automatically checksummed. The checksum is validated after reboot. If checksumming is enabled and the stored checksum and newly computed checksums match, the block is available to subsequent FindNamedMemory calls. Otherwise, the block is discarded. If no checksumming is enabled for the block, the application must ensure data integrity.

To be documented:

AllocNamedMemory()
UpdateNamedMemory()
AttemptNamedMemory()
FreeNamedMemory()
FindNamedMemory()
UnlockNamedMemory()
ScanNamedMemory()
LockNamedMemory()