STRIDE 3.0.01xx

From STRIDE Wiki
Revision as of 23:44, 28 May 2008 by Shamr (talk | contribs) (→‎PAL)
Jump to navigation Jump to search

Release Notes

This page documents the changes in STRIDE version 2.1.0301 (code name StoneSteps).

Please review this information before upgrading from an earlier version.

What's New

Based on customer requirements, in this release we have made significant changes to STRIDE Runtime and PAL.

Multi-Process Targets / Shared Memory

New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of shared memory, protecting using named Mutex objects, synchronization of multiple processors ands multiple threads, and usage of current process and thread IDs.

Runtime Logging (Optional)

Runtime and PAL use a logging routine that can optionally be implemented in PAL.

Change Details

Shared Memory

To support multi-process target, shared memory support for dynamic and static pool memory has been implemented in Runtime. Runtime makes PAL calls to acquire shared memory and manages the memory according to runtime configurations set by user.

Protection using Mutex

Runtime now uses named mutex objects to protect shared resources between multiple processors and multiple threads. Runtime makes PAL calls to obtain and control mutex objects.

PAL

New Routines

  • Shared Memory Management

Recommended approach is to use Memory-Mapped Files to implement shared memory.

palOpenSharedMem - Open/Create shared memory segment 
palCloseSharedMem - Close shared memory segment
  • Named Mutexes
palMutexInit - Initialize a mutex object
palMutexDestroy - Destroy a mutex object
palMutexLock - Lock a mutex object
palMutexUnlock - Unlock a mutex object
  • Task Synchronization
palGetThreadId - Get current thread Id
palGetProcessId - Get current process Id
palSleep - Suspend the execution of the current thread
  • Logging

This is optional.

palLog - Logging utility

Updated Routines

Function signatures of palMemAlloc() & palMemFree() have been updated.

palMemAlloc - now returns a void pointer
palMemFree - now takes in a void pointer as input

Removed / Old Routines

palProtect
palUnprotect
palCriticalErr

Runtime

  • STRIDE Host Release 2.1.0301 is compatible with the Runtime versions 3.0.
  • To support multi-process target, significant changes have been made to runtime.
  • A new public routine, srUninit(), has been added to sr.h & srapi.c.
  • To use in PAL for shared dynamic pool memory, new routines, _srMem_Allocate() & _srMem_Free(), have been added as part of new runtime files srmem.h & srmem.c.
  • Calls to palProtect() & palUnprotect() have been replaced by new routines _srProtect() & _srUnprotect(), in which the implementation uses its own mutex object that calls PAL's mutex routines.
  • The following Runtime files have been modified:
sr.h
srapi.c
srconn.c
srconn.h
srib.c
srib.h
sribtr.c
sribtr.h
srmsgptr.c
srmsgptr.h
srmsgque.c
srmsgque.h
srmsgrt.c
srmsgrt.h
srmsgsub.c
srmsgsub.h
srstid.c
srstid.h
srsuid.c
srsuid.h
srtime.c
srtime.h
  • The following Runtime files have been added:
srmem.c
srmem.h

Migration to 2.1.0301

Recommended steps for migration from a previous version:

PAL

Please refer to Platform Abstraction Layer (PAL) Specification for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.

  • Implement new shared memory routines, palOpenSharedMem() & palCloseSharedMem(), using memory-mapped files.
  • Runtime now manages shared dynamic pool memory. Update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free() for the shared memory case. For the non-shared case, you can leave the current implementation as it is.
  • Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() & palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.
  • Remove old routines palProtect(), palUnprotect() and palCriticalErr().
  • Implement new routines palGetThreadId() and palGetProcessId().
  • Implement new routine palSleep().
  • Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() & palNotify(), to support sharing of the synchronization objects among multiple processors if shared memory management is enabled.
  • Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.

Runtime

  • Edit srcfg.h file to configure the shared memory management. By default, shared memory is disabled. If you decide to enable shared memory, you also need to configure the sizes and max number of memory blocks. New runtime module srmem uses these configurations to allocate and manage shared dynamic pool memory.

Host Apps using Target Runtime lib s2shostapptrt

  • A new routine, HostAppSetMaster(), has been added to s2shostapptrt library. This routine needs to be called from the application that should be starting the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the master process or the daemon calls this routine.