Ticket #760 (closed defect: fixed)
Opened 2011-09-16T13:13:01-05:00
Last modified 2011-10-24T14:47:41-05:00
IJ1 Plugins that hatch threads are problematic
Reported by: | bdezonia | Owned by: | bdezonia |
---|---|---|---|
Priority: | critical | Milestone: |
|
Component: | Legacy Compatibility | Version: | |
Severity: | critical | Keywords: | |
Cc: | Blocked By: | ||
Blocking: |
Description
Currently LegacyPlugin relies on the assumption that the plugin that gets called does not return with worker threads still running. If a plugin does this then LegacyPlugin might not capture all it's outputs or close all windows that should close.
Unfortunately the IJ1 plugin named Compile And Run does just this. As designed many plugins will cause the legacy layer problems.
Change History
comment:1 Changed 2011-09-16T13:31:59-05:00 by bdezonia
comment:2 Changed 2011-10-24T10:11:37-05:00 by bdezonia
See also #688
In general our solution cannot handle multithreaded plugins. A better approach: more nearly mirror IJ1. Make LegacyPlugin have NO outputs. Have application own a thread running some new harmonizer that is a combination of LegacyImageMap and Harmonizer. ImagePlusMethods could request harmonization upon detection of draw/show kinds of calls. This new harmonizer would always be translating back and forth as needed. LegacyPlugin::run() could request harmonizations before calling the IJ1 plugin. Thus multithreaded plugins always display data as expected (unless they are highly interactive).
This needs further discussion before we make any decisions.
Here is a plugin run() method that causes problems:
The first time you run it no output is shown. The subsequent runs immediately show an image (likely the last one that was created in the previous run).