Coder Social home page Coder Social logo

Comments (5)

kekekeks avatar kekekeks commented on June 16, 2024

This issue only occurs in beta2, beta 1 works as expected.

481 changed files with 15,759 additions and 6,408 deletions.

Could you bisect a bit further?

from avalonia.

amwx avatar amwx commented on June 16, 2024

This is what I got

eee71a62718653583f6b2e96f873a8f945701eaf is the first bad commit
commit eee71a62718653583f6b2e96f873a8f945701eaf
Author: Steven Kirk <[email protected]>
Date:   Sat Apr 20 03:29:12 2024 +0300

    Fix input starvation issues on resource-constrained devices. (#15137)

    * Use 0.2 seconds for input starvation cutoff.

    1 second was too long when running on resource-constrained devices.

    * Allow input starvation code to run.

    Using `ScheduleRender(true)` here prevented the input starvation code from running.

    * Add DispatcherOptions.

    And allow setting the input starvation timeout there.

 src/Avalonia.Base/Media/MediaContext.Compositor.cs |  2 +-
 src/Avalonia.Base/Media/MediaContext.cs            | 13 ++++++++++---
 src/Avalonia.Base/Threading/DispatcherOptions.cs   | 21 +++++++++++++++++++++
 3 files changed, 32 insertions(+), 4 deletions(-)
 create mode 100644 src/Avalonia.Base/Threading/DispatcherOptions.cs

Edit: Adding this seems to make the deadlock less likely to happen (though it still can):
new DispatcherOptions { InputStarvationTimeout = TimeSpan.FromSeconds(10) }

from avalonia.

kekekeks avatar kekekeks commented on June 16, 2024

That particular PR has changed the way composition batches are being scheduled on the UI thread.

Are you sure that you aren't trying to call _mutex->AcquireSync before the latest UpdateWithKeyMutexAsync is completed?

from avalonia.

kekekeks avatar kekekeks commented on June 16, 2024

I. e. the input starvation logic can enforce all input to be handled before scheduled render pass. So if you aren't awaiting the latest task it would indeed result in a deadlock once that kicks in.

from avalonia.

amwx avatar amwx commented on June 16, 2024

Ok, I've gotten it fixed by ensuring the Task completed before attempting to render again.

I used the GpuInterop sample as reference for this and on the surface, the only place the LastPresent task is used in the sample is in the Dispose method, I had to go hunting elsewhere to find that it is actually checked before another pass.

from avalonia.

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.