I’ve got a custom C++ analyzer that for various reasons is very slow (serial protocol, I’m currently outputting too much data, etc). If I remove it from a trace while it’s running and try to re-add it, nothing happens; and I see my analyzer still continuing to run the WorkerThread loop.
What’s the proper way to interrupt this? Is there some notification that the Analyzer went away? I tried adding a flag in my destructor (before the “KillThread”) that I check in the loop, but that doesn’t work (is never set), I assume because the same Analyzer instance is reused?
How does this WorkerThread mechanism work when I have state I’m tracking through my loop? i.e. bits that I’m accumulating. Am I guaranteed a new worker thread per instance of the analyzer? How does the thread actually get killed – is this just pthread_cancel? What if I allocated some temporary objects during the analysis, are these just leaked?
(Warning: minor rant) Also, separately, creating analyzers is super frustrating. The hardware is amazing, and the software is great – but writing custom analyzers is about 1000x more convoluted than it needs to be. Not even basic debug symbols (or frame pointers) seem to be provided for the Logic shared libraries, making debugging basically impossible; I’ve resorted to printf debugging. Documentation is very lacking. The overall analyzer model is just bad and needs to be rethought out. It should be a high level language with quick iteration cycles – there’s already some yet-separate work for the high level analyzers for python; why just “high level”? Or better yet, just expose to javascript; you’re already using electron/chromium to drive the front end, you have everything you could need to build a nice, performant analyzer interface. Contrast all this to how easy it is to create analyzers for sigrok; Logic looks and feels a ton more polished, but sigrok has it beat in this area hands down. (End rant. Sorry guys, I really do love the hardware and software, but man…!)