Commit Graph

172 Commits

Author SHA1 Message Date
hayodea 3a50be05f8 Qutex: nRequiredLocks==1 at front should never call backoff 2025-10-04 14:52:02 -04:00
hayodea eb5875fe0d Rename: Sense API => Stim Buff API 2025-10-01 20:03:47 -04:00
hayodea 56b8e83a09 Update senseApiDesc.h and opts.cpp for clarity in device attachment and usage examples 2025-10-01 18:20:59 -04:00
hayodea a66d91fa31 DevAttachment:Rename: api=>stimbuffapi, implexor=>qualeiface 2025-10-01 18:10:58 -04:00
hayodea e9e273c012 CMake: PRefix config opt with CONFIG_ 2025-10-01 11:02:28 -04:00
hayodea 942f9d8515 DevMgr: formatting 2025-10-01 10:21:32 -04:00
hayodea 1e22656299 DevMgr: Call uniq_ptr.release on DeviceReattacher 2025-10-01 10:19:08 -04:00
hayodea 55fe2675df DevMgr: Use releaseQutexEarly 2025-09-30 22:53:17 -04:00
hayodea af19125ac2 Qutex: Add check for double-release() 2025-09-30 22:53:01 -04:00
hayodea 7ddbde1a2f DevMgr:removeDASpec: Make serialized; acquire DevMgr qutex 2025-09-30 22:10:39 -04:00
hayodea ac3d97b3ec DevMgr:newDASpecInd: now lockvoked, acquires DevMgr qutex
We now acquire the DevMgr qutex when doing the newDASpecInd async
op. The qutex is held across an async sequence with potentially
a real hardware blocking bottleneck.
2025-09-30 22:01:34 -04:00
hayodea 274143e41d Formatting 2025-09-30 21:40:26 -04:00
hayodea d75430ef82 Qutex: Document the need to deal with early release()s 2025-09-30 21:25:58 -04:00
hayodea 06f3f2eebe DevMgr:attachAllUnattachedDevicesFromKnownListReq: acquire qutex
We should acquire the qutex here before iterating through the list
of DA specs.
2025-09-30 21:24:51 -04:00
hayodea 07609c6d6c SenseApiLib:Add isBeingDestroyed atomic flag for getter bailout
Since we have no choice but to access the sh_ptr<SenseApiLib> for
a lib before we can get its Qutex, we use this flag to ensure that
we can know whether the SenseApiLib data structure and its Qutex
are still valid when we enter -- i.e, we ensure that the SenseApiLib
object wasn't destroyed under our feet.
2025-09-30 21:01:00 -04:00
hayodea 1bad358921 DevMgr:at/detachSenseDevReq: release SenseApiMgr Qutex early
Release it early when we no longer need it.
2025-09-30 20:29:39 -04:00
hayodea 77e123ff4a DevMgr:at/detachSenseDevReq: acquire SenseApiMgr qutex 2025-09-30 19:53:57 -04:00
hayodea 9c3a8ea695 Indentation 2025-09-30 19:51:50 -04:00
hayodea 0ff86a0a5e SenseApiMgr: Add Qutex 2025-09-30 19:51:01 -04:00
hayodea 8ad5179a61 DevMgr:at/detachSenseDevReq: only acquire API lib lock
We don't actually manipulate any of SenseApiMgr or DevMgr's state
so there's no need to acquire their locks.
2025-09-30 19:47:23 -04:00
hayodea e600b0f96e DevMgr:at/detachSenseDevReq: acquire Api lib Qutex 2025-09-30 18:12:20 -04:00
hayodea b0d61c3e38 DevMgr:at/detachSenseDevReq: Acquire DevMgr Qutex 2025-09-30 14:22:51 -04:00
hayodea ccf0ab77bf Move SerializedAsyncContin template method impls into header 2025-09-30 13:59:07 -04:00
hayodea 33b61f429a LockSet: Move method impls into template header 2025-09-30 13:42:13 -04:00
hayodea 7ded9d287d Split comment into relevant locations 2025-09-30 13:27:06 -04:00
hayodea f15c07bc83 LockSet:tryAcquireOrBackoff use optional<ref_wrapper<Qutex>>
Replace the previous Qutex** raw pointer with a std::optional.
2025-09-30 10:36:19 -04:00
hayodea e299e956e5 Move LockSet::release into header 2025-09-30 03:01:13 -04:00
hayodea ca9eae197f Lockvoker: Add registerInLockSet
We now create the sh_ptr to the copy of a lockvoker object in its
own supplied register method. This enables us to retain type safety
when calling make_shared, by copying the most derived version of
the lockvoker object. Then we can pass in the LockerAndInvokerBase
to the rest of the call chain.
2025-09-30 02:55:25 -04:00
hayodea 08122c086c LockSet:tryAcquireOrBackoff: should take Qutex**, not Qutex*
No idea how this error survived in here for so long.
2025-09-30 02:53:54 -04:00
hayodea cb8b13d0cd LockSet:release() Remove superfluous Lockvoker arg
We decoupled unregistration from release() so we no longer need
to pass in a lockvoker to release().
2025-09-30 02:17:46 -04:00
hayodea 97d93c670e Indentation 2025-09-30 01:15:30 -04:00
hayodea 9d77e8b345 SenseApiLib: Add qutex for lib state access serialization 2025-09-30 01:14:00 -04:00
hayodea 4bf19fda90 Get rid of rvalue ref returns 2025-09-30 00:37:54 -04:00
hayodea ed9635582f Lockvoker: add handleGridlock and invoke it 2025-09-30 00:32:54 -04:00
hayodea d06ba8957a QtxAcqHistTracker: Implement complete algo; add depend graph
The dependency graph class enables us to perform analysis on the
qutex acquisition history data. By generating the graph and
detecting cycles in it, we can find true gridlocks.

We use this graph analysis code to implement the algorithmically
complete version of the gridlock detector.
2025-09-30 00:24:33 -04:00
hayodea 1aec779351 CMake: Conditionally build QtxAcquisitionHistTracker 2025-09-29 21:09:31 -04:00
hayodea 6baa0bb008 Silence build warning 2025-09-29 20:48:49 -04:00
hayodea 274edc1013 QtxHistTracker: Print message on heuristic gridlock find 2025-09-29 20:47:04 -04:00
hayodea c0eecf76d4 QtxAcqHistTracker: Add spinlock and use it 2025-09-29 20:34:56 -04:00
hayodea 2390042892 QtxAcqHistTracker: implement heuristic gridlock detector 2025-09-29 20:02:23 -04:00
hayodea 5c7a92b3a4 SerializedAsyncContin:getAcquiredQutexHistory returns rval ref
This ensures that the caller takes ownership.
2025-09-29 19:40:51 -04:00
hayodea 71564b4d83 Add QutexAcquisitionHistoryTracker; integrate plumbing
We add the new Qutex acquisision history tracker that allows us
to dynamically detect qutex gridlocks. We've integrated it into
LockerAndInvoker::operator() in a preliminary way.

We also moved all of the trace*ForGridlockOn() methods into the
new QutexAcquisitionHistoryTracker singleton class. They're
more appropriately located there. They're still unimplemented
though.
2025-09-29 19:27:02 -04:00
hayodea 8123ec1227 Qutex: Deprecate old gridlock trace; add skeleton new trace
We add the skeleton of a correct history tracer for gridlocks. The
previous history tracer made the incorrect assumption that we would
find the foreign sequence's currently desired LockSet inside of the
lockvoker that it has stored inside of Qutex::currOwner.
2025-09-29 18:14:10 -04:00
hayodea 2a60fdd9df Qutex: currOwner should use registered sh_ptr to Lockvoker
This ensures that the Lockvoker object we access from currOwner
remains valid past the lifetime of the Lockvoker object that
gets copied and invoked by boost::asio
2025-09-29 14:37:16 -04:00
hayodea 462247d743 Qutex: Add gridlock detection 2025-09-29 13:38:53 -04:00
hayodea 6b4fe05fc0 Qutex: Add gridlock detection wireframing
This is the basic wireframing required to enable us to detect
gridlocks among requests.
2025-09-29 12:58:41 -04:00
hayodea 7e514a1fa3 Qutex: Add currOwner pointer for debugging
We'll use this to detect gridlock-type deadlocks between
two requests
2025-09-29 12:40:43 -04:00
hayodea 542e3081ad DevReattacher: Use aggregate init for Callback<> 2025-09-29 01:59:52 -04:00
hayodea cea65dcd00 Mrntt: Call initializeDeviceReattacher in init
It works surprisingly well on the first try.
2025-09-29 01:07:32 -04:00
hayodea 6cebf6856e Indentation 2025-09-28 23:35:20 -04:00