Note that there are some explanatory texts on larger screens.

plurals
  1. POC# Running IronPython On Multiple Threads
    primarykey
    data
    text
    <p>I have a WPF app that controls audio hardware. It uses the same PythonEngine on multiple threads. This causes strange errors I see from time to time where the PythonEngines Globals dictionary has missing values. I am looking for some guidance on how to debug/fix this. </p> <p>The device has multiple components [filter's, gain's, etc.]. Each component has multiple controls [slider's,togglebutton's, etc.]. </p> <p>Everytime a user changes a control value a python script (from the hardware vendor) needs to run. I am using IronPython 1.1.2(PythonEngine.Execute(code)) to do this. </p> <p>Every component has a script. And each script requires the current values of all controls (of that component) to run.</p> <p>The sequence is - user makes change > run component script > send results to device > check response for failure. This whole cycle takes too long to keep the UI waiting so everytime something changes I do something like component.begininvoke(startcycle).</p> <p>Startcycle looks something like this -</p> <pre><code>PyEngine Engine = PyEngine.GetInstance(); // this is a singleton lock(component) // this prevents diff controls of the same component from walking over each other { Engine.runcode(...) } </code></pre> <p>When <em>different</em> component.begininvokes happen close to each other there are chances where engine.runcode is happening on different threads at the same time. It looks like I need to get rid of the component.begininvoke but that would make things crawl. Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload