Hi Min, all methods in your user-defined function are always run in the same thread - they cannot occur simultaneously. That includes all functions related to state management (snapshotState, initializeState), life-cycle (open, close), and timers.
To support multiple slots per machine, Flink maintains a thread per subtask and creates a copy of your user-defined function for each subtask. Best, Arvid On Sat, Oct 31, 2020 at 10:57 PM Jaswin Shah <jaswin.s...@outlook.com> wrote: > They are designed to avoid race condition. > > Get Outlook for Android <https://aka.ms/ghei36> > > ------------------------------ > *From:* Tan, Min <min....@ubs.com> > *Sent:* Sunday, November 1, 2020 2:15:54 AM > *To:* user <user@flink.apache.org> > *Subject:* CoProcessFunction processElement1 and processElement2 > > > Hi, > > > > Can someone confirm that the processElement1 and processElement2 are run > sequentially? not in paradelle. > > > > Thank you very much in advance. > > > > Regards, > > > > Min > -- Arvid Heise | Senior Java Developer <https://www.ververica.com/> Follow us @VervericaData -- Join Flink Forward <https://flink-forward.org/> - The Apache Flink Conference Stream Processing | Event Driven | Real Time -- Ververica GmbH | Invalidenstrasse 115, 10115 Berlin, Germany -- Ververica GmbH Registered at Amtsgericht Charlottenburg: HRB 158244 B Managing Directors: Timothy Alexander Steinert, Yip Park Tung Jason, Ji (Toni) Cheng