Giter VIP home page Giter VIP logo

Comments (7)

fjtrujy avatar fjtrujy commented on May 25, 2024

Ping @davidgfnet and @uyjulian to be the most experts on this area

from ps2sdk.

fjtrujy avatar fjtrujy commented on May 25, 2024

I have tried reverting https://github.com/ps2dev/ps2sdk/pull/470/commits and it looks to works fine, so it must be an issue introduced there:

Bigger diff: 22, requested: 10395, got: 10417

from ps2sdk.

uyjulian avatar uyjulian commented on May 25, 2024

nanosleep says https://man7.org/linux/man-pages/man2/nanosleep.2.html

nanosleep() suspends the execution of the calling thread until either at least the time specified in *req has elapsed

So this would be conformant behavior either way, but more accuracy is better

from ps2sdk.

irixxxx avatar irixxxx commented on May 25, 2024

nanosleep says https://man7.org/linux/man-pages/man2/nanosleep.2.html

nanosleep() suspends the execution of the calling thread until either at least the time specified in *req has elapsed

So this would be conformant behavior either way, but more accuracy is better

While being technically correct I have never seen anything like this in any Posix compatible system under low load. I don't have the proceedings anymore, but I think this provision was added to cover for systems under load where a timely scheduling after the timer expires isn't guaranteed.

from ps2sdk.

davidgfnet avatar davidgfnet commented on May 25, 2024

Seems like a regression to me.
Just for sanity checking it would be great to validate that clock_gettime is not returning garbage every now and then (it likely won't but better safe than sorry!)

from ps2sdk.

fjtrujy avatar fjtrujy commented on May 25, 2024

Seems like a regression to me. Just for sanity checking it would be great to validate that clock_gettime is not returning garbage every now and then (it likely won't but better safe than sorry!)

I have specifically checked that, and it looks to work fine, as I did a similar example, this time instead of putting a usleep in the middle, I put a function to generate the first X prime numbers, and the values look to be right too.

from ps2sdk.

irixxxx avatar irixxxx commented on May 25, 2024

I inspected the code and I think it might be related to the timer overflow handling. That ApplyOverflow and its being called several times in the timer irq looks suspicious to me.

from ps2sdk.

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.