Coder Social home page Coder Social logo

Comments (3)

myroot avatar myroot commented on May 14, 2024 1

As you mentioned, Post method does not guarantee the order of call.
Our implementation is depend on EFL. So behavior of API also same with EFL
And Post method implemented with ecore_idler_add. ecore_idler_add also does not guaranteed

from tizenfx.

myroot avatar myroot commented on May 14, 2024

Yes, you're right.
It should be called idle step on main loop iteration.
I also expected ecore_main_loop_safe_call_async working as asynchronous but does not

Fortunately, EcoreSynchronizationContext is not used in normal case.
Instead TizenSynchronizationContext is used

If you need a Post behavior on your application, You can use EcoreMainloop.Post method

Anyway, I'll fix it

Thanks your reports

from tizenfx.

ppaneksamsung avatar ppaneksamsung commented on May 14, 2024

Hello,

Your change fixes the reported problem, however it introduces another one. Basically, the documentation doesn't mention anything about call order, but some applications expect that:

EcoreMainLoop.Post(action1);
EcoreMainLoop.Post(action2);

will result that action1 will be called before action2. That's not true for Post method (and PostAndWakeUp called on the main thread). Please check following snippet:

for (var i = 0; i < 10; ++i)
{
  var val = i;
  EcoreMainloop.PostAndWakeUp(() => { Log.Info("LoopTest", $"{val}"); });
}

When called on the main thread, it prints:

I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 9
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 8
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 7
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 6
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 5
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 4
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 3
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 2
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 1
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(61) > 0

When called on a non-main thread, it prints:

I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 0
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 1
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 2
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 3
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 4
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 5
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 6
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 7
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 8
I/LoopTest(10974): XamarinPlayer.Tizen.cs: OnCreate(70) > 9

Example when such behavior causes a problem can be found here:
https://github.com/Samsung/react-native-tizen-dotnet/blob/master/Framework/ReactNet/ReactNativeTizen/DevSupport/DevOptionDialog.cs
The line 92 is executed after 46.

from tizenfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.