Skip to content

Avoid busy polling in the reader thread #12

Open
@RinHizakura

Description

@RinHizakura

We'll observe 100% CPU usage by the reader thread when the GDBSTUB is running, and the reason is because the socket_reader keeps polling the status variable.

In #10, @fabiomurer tried to introduce a condition variable approach to solve; however, due to the wrong synchronization, the gdbserver can sometimes fail to interrupt the gdbstub. Specifically, we need to verify these behaviors for the proposed fix:

  • We need to make sure the emulator can be paused if sending an interrupt(like CTRL+C)
  • We must ensure the reader thread can end if the emulator stops.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions