Hi, Digging a bit into SequencedEvent event clients, I've found 3 usages:
1) Wrapping focus in and out window events (Unix only) 2) Wrapping TimedWindowEvent events (Windows and macOS only) 3) Wrapping FocusEvent events in XEmbedChildProxyPeer.simulateMotifRequestFocus (Unix only) This is how case #1 works in Linux: There is a single thread retrieving all X11 events, called AWT-XAWT. This thread is turning raw X11 events into more generic/high-level ones and posting them to different EDT queues (depending on the event target). Works as a demultiplexer. In particular, FOCUS-IN and FOCUS-OUT events may be sent to different target windows and dispatched by different EDTs. Synchronization is needed because otherwise the sequence order may be broken. Let's assume that AWT-XAWT gets a FOCUS-OUT to window B first and FOCUS-IN to window A then. EDTs can be scheduled so that a FOCUS-IN sent to window A is dispatched before a FOCUS-OUT to windows B. This execution does not represent what really happened. What we want, at the end of the day, is synchronizing window listeners across different EDTs with focus transitions. I don't see how receiving asynchronous events (non-SequencedEvent events) in-between would be different than receiving them after a transition to a no-focus (FOCUS-OUT and no FOCUS-IN received). What are the concerns regarding dispatching non-Sequenced events while waiting? @Denis: looks to me that a single ordered list matters here. Events are already synchronized if we look into single EventQueues. The problem is synchronizing through multiple EventQueues and multiple EDTs (which is a Java abstraction). Kind regards, Martin.- On Fri, Oct 26, 2018 at 12:11 PM, Denis Fokin <denis.fo...@gmail.com> wrote: > Hi guys, > > just out of curiosity, should not we store the SE lists per-AppContext? > > Thank you, > Denis > > On Fri, Oct 26, 2018 at 1:35 AM Krishna Addepalli < > krishna.addepa...@oracle.com> wrote: > >> Hi Sergey, >> >> I also agree with Laurent about root cause of hang provided by Martin. >> However, we just need to make sure that non Sequenced Events are not >> dispatched when SequencedEvents are being dealt with. >> >> Thanks, >> Krishna >> >> >> On 25-Oct-2018, at 1:35 PM, Laurent Bourgès <bourges.laur...@gmail.com> >> wrote: >> >> Hi Sergey & Martin, >> >> >>> > AWT experts, what do you advice about asynchronous events: to Block or >>> to dispatch selected awt events... >>> >>> I think that before answer this question we need to clarify why the >>> current code hangs. >>> >> >> According to me, Martin already exposed his detailled analysis of 2 cases >> making AWT to hang with several AppContexts: in summary, like a deadlock, >> the EDT threads are waiting for each other to dispatch SequencedEvents ! >> >> Please Martin correct me, or maybe give us an updated diagnostic of the >> problem ? >> >> This thread is already quite long and both Martin & me invested a lot of >> time on debugging, fixing & testing, please give us your understanding, >> Sergey. >> >> Finally I am in favor of Martin's patch 2 sent by Oct 16th: >> http://cr.openjdk.java.net/~mbalao/webrevs/8204142/8204142.webrev.02 >> >> Cheers, >> Laurent >> >> >>