STRIDE 3.0.01xx: Difference between revisions
Line 95: | Line 95: | ||
You may reference Linux implementation of PAL, which has been updated to support shared memory. | You may reference Linux implementation of PAL, which has been updated to support shared memory. | ||
* Implement new shared memory routines using memory-mapped files. | * 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. | * 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 to handle any named mutex objects. It is recommended to implement a separate code for shared memory case. | * 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() and palUnprotect(). | * Remove old routines palProtect() and palUnprotect(). | ||
Line 107: | Line 107: | ||
* Implement new routine palSleep(). | * Implement new routine palSleep(). | ||
* | * Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() & palNotify(), to support sharing of the synchronization objects among multiple processors. | ||
* Optionally, implement new routine palLog() as a logging utility for PAL and Runtime. | |||
==Runtime== | ==Runtime== |
Revision as of 18:50, 22 May 2008
This page documents the changes in Version 2.1.0301 of STRIDE (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.
Support for Multi-Process Target
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
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
Removed / Old Routines
palProtect palUnprotect
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.
- 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
You may reference Linux implementation of PAL, which has been updated to support shared memory.
- 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() and palUnprotect().
- 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.
- Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.
Runtime
Host-based TargetApps using s2shostapptrt library
- A new routine, HostAppSetMaster(), has been added to s2shostapptrt library. This routine needs to be called from the process that starts the runtime thread, srThread, before calling HostAppRun(). Usually within a multi-process target, the "master" process or the daemon calls this routine.