inexorgame-obsolete / deprecated-cube-engine-inexor

UNMAINTAINED: Please have a look at the vulkan-renderer
https://inexor.org
zlib License
11 stars 1 forks source link

Inexor Core startup consumes 100% CPU #412

Closed aschaeffer closed 7 years ago

aschaeffer commented 7 years ago

When Inexor Flex starts Inexor Core but doesn't connect to it, the Inexor Core process consumes 100% CPU.

a-teammate commented 7 years ago

We are using 100% CPU bc we're constantly checking the non-blocking gRPC queue until a certain event arrives.

  1. I just noticed that I disabled the timeout in the master branch for that loop, Ill reenable it.

  2. I think we could just switch to the blocking gRPC API and its fixed

    • iirc the reason i used that non-blocking gRPC loop was to handle non-relevant events as well .. but i think that thinking is nuts

A general thought, though:

in how far should we consider 100% CPU usage a bug? Is it preventing you from doing anything else on the computer? plz describe.

aschaeffer commented 7 years ago

I've added a micro sleep in pr #439 for the initialization routine. This fixes the 100% cpu load. The async method is not necessary but also not wrong. Therefore we should let it until we have a reason for either using sync or async in the initialization routine. Also I don't see a need for a timeout since Inexor Flex can kill that process by itself.