Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 194287

Summary: [OLE] syncexec does not execute in timely manner
Product: [Eclipse Project] Platform Reporter: bugzilla
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact: Felipe Heidrich <eclipse.felipe>
Severity: normal    
Priority: P3 CC: Silenio_Quarti, snorthov
Version: 3.3Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows All   
Whiteboard: stalebug

Description bugzilla CLA 2007-06-25 15:28:38 EDT
When the display receives a lot of OS events, (a)syncExec calls do not get processed in a timely fashion. This happened specifically when using OLE automation to embed a flash movie that was using upto 100% of CPU. 

Looking at readAndDispatch() in Display it will only process these (a)syncExec calls if there are no OS messages to handle, so a busy activex object can and does starve the (a)syncExec call handling

I use the 3.2.2 stable release but tried also with 3.3RC4 which has the same problem. However, did not try the workaround on 3.3RC4 but Display.java code still looks the same.

A workaround with current stable version is to dispatch these (a)syncExec calls via a custom queueing mechanism on the display thread since they then get executed immediately by the synchronizer.

Something like;
            while(keepRunning) {
                Runnable r = null;
                synchronized(messageQueue) {
                    if(!messageQueue.isEmpty()) {
                        r = (Runnable)messageQueue.remove(0);
                    }
                }
                if(r != null) {
                    swtDisplay.syncExec(r);
                } 
            	
                if(!swtDisplay.readAndDispatch()) {
                    swtDisplay.sleep();
                }
            }
Comment 1 Steve Northover CLA 2007-08-14 12:32:14 EDT
By definition, syncExec()'s run when the UI is idle.  If the UI is not idle (due to an OLE control), then they will not run.

Duong to construct a test case.  Note that the fix (if any) might be similar to the "run in idle" hack that Drag and Drop uses.
Comment 2 Felipe Heidrich CLA 2009-08-13 11:14:11 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 3 Leo Ufimtsev CLA 2017-08-03 12:27:14 EDT
This is a one-off bulk update. (The last one in the triage migration).

Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process:
https://wiki.eclipse.org/SWT/Devel/Triage

See Bug 518478 for details.

Tag for notification/mail filters:
@TriageBulkUpdate
Comment 4 Eclipse Genie CLA 2020-03-06 16:20:47 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.