Giter Club home page Giter Club logo

Comments (3)

hrydgard avatar hrydgard commented on August 20, 2024

I think it's something like this:

  • Priorities go from low to high. That is, a higher priority number means that the thread has lower priority.
  • There's a "ready queue", of all the threads that are ready to run right now (not WAIT or STOPPED). What RotateReadyQueue does it to put the current thread on the end of this queue, and then walks the queue until it finds another thread that has the same or lower priority number, and context switches to it. This way, threads with a higher priority number will indeed NEVER run after RotateThreadReadyQueue if there are threads with a lower priority around.

I didn't think RotateThreadReadyQueue had an argument?

We need to simply implement this ready queue and insert/remove threads from it when threads wait and stop and resume etc.

Exactly how a regular rescheduling chooses the next thread, I'm not clear about. But I think also there it's the case that if there are ready threads with a lower priority number, a high-priority-number thread will NEVER run.

from ppsspp.

unknownbrackets avatar unknownbrackets commented on August 20, 2024

I see, the current thread's priority. That makes sense.

This says it has a parameter but it could definitely be wrong:

http://psp.jim.sh/pspsdk-doc/group__ThreadMan.html#gaa8bc5f547a985ed13ec982bc83c0a895

That said, when passing two separate parameters, different results are very reproducible. If you reverse the calls or etc. So it seems like there's a parameter that does something.

Debugging since I created this issue, I found that the actual problem here might be that wait timers are firing on deleted threads. Making a change to not reuse slots in the kernel object pool, things became fair (and also much slower than the PSP.)

-[Unknown]

from ppsspp.

hrydgard avatar hrydgard commented on August 20, 2024

Can we close this?

from ppsspp.

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.