Conversation
`PinMameGamelogicEngine.Update()` now copies `_dispatchQueue` callbacks into a reusable local list under the queue lock, then releases the lock before invoking them. This removes callback execution time from the producer-contention window while preserving callback order and exception handling.
`PinMameGamelogicEngine` warns on main-thread dispatch queue growth and simulation-coil queue overflow.
…cks. The solenoid-delay timing check now uses a monotonic `Stopwatch`-based timestamp instead of `DateTimeOffset.Now`, and high-frequency coil callback logs were downgraded behind `Logger.IsDebugEnabled` so normal runtime no longer pays string-format/logging cost on every coil edge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR stabilizes the PinMAME Unity integration around play mode lifecycle, cross-thread event dispatch, and shared-state handoff with the simulation thread. It also updates the PinMAME .NET dependency to 1.0.2, which uses the lastest PinMAME 3.7 beta.
Lifecycle and shutdown safety
PinMamePlayModeLifecycle) to coordinate deterministic PinMAME shutdown on play mode exit/editor quit.PinMameGamelogicEngineinit/stop flow with start/stop gating and defensive unsubscribe/cleanup paths.StopForPlayModeExit()and improvedOnDisable/OnDestroy/OnApplicationQuithandling to avoid stale callbacks and overlapping sessions.Threading and performance instrumentation
IGamelogicInputThreadingIGamelogicTimeFenceIGamelogicCoilOutputFeedIGamelogicSharedStateWriterIGamelogicSharedStateApplierIGamelogicPerformanceStatsTryDequeueCoilEvent), including backlog/drop warnings.TryGetPerformanceStats.Shared state publication / application
WriteSharedState+ApplySharedState) with lock-protected state caches.Display / output handling improvements
DisplayFrameFormat.Dmd8.Mech and misc fixes
PinMameMechComponentfor clearer mapping error logs.Testing